Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django 4.2 upgrade #1134

Merged
merged 14 commits into from
Jul 12, 2023
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
[
"django32-drflatest",
"django40-drflatest",
"django42-drflatest",
UsamaSadiq marked this conversation as resolved.
Show resolved Hide resolved
"quality",
"pii_check",
"version_check",
Expand Down Expand Up @@ -57,7 +58,7 @@ jobs:
run: tox

- name: Run Coverage
if: matrix.toxenv == 'django32-drflatest'
if: matrix.toxenv == 'django42-drflatest'
uses: codecov/codecov-action@v3
with:
flags: unittests
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ Change Log

Unreleased
~~~~~~~~~~
[4.16.0] - 2023-06-22
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Support added for Django 4.2

[4.15.1] - 2023-04-19
~~~~~~~~~~~~~~~~~~~~~
Expand Down
4 changes: 1 addition & 3 deletions edx_proctoring/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@
"""

# Be sure to update the version number in edx_proctoring/package.json
__version__ = '4.15.1'

default_app_config = 'edx_proctoring.apps.EdxProctoringConfig' # pylint: disable=invalid-name
__version__ = '4.16.0'
12 changes: 5 additions & 7 deletions edx_proctoring/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class Meta:
fields = '__all__'


@admin.register(ProctoredExam)
salman2013 marked this conversation as resolved.
Show resolved Hide resolved
class ProctoredExamAdmin(admin.ModelAdmin):
"""
Admin panel for Proctored Exams
Expand All @@ -51,6 +52,7 @@ class ProctoredExamAdmin(admin.ModelAdmin):
search_fields = ['course_id', 'exam_name']


@admin.register(ProctoredExamReviewPolicy)
class ProctoredExamReviewPolicyAdmin(admin.ModelAdmin):
"""
The admin panel for Review Policies
Expand Down Expand Up @@ -244,6 +246,7 @@ def queryset(self, request, queryset):
)


@admin.register(ProctoredExamSoftwareSecureReview)
class ProctoredExamSoftwareSecureReviewAdmin(admin.ModelAdmin):
"""
The admin panel for SoftwareSecure Review records
Expand Down Expand Up @@ -320,6 +323,7 @@ def lookup_allowed(self, lookup, value):
return super().lookup_allowed(lookup, value)


@admin.register(ProctoredExamSoftwareSecureReviewHistory)
class ProctoredExamSoftwareSecureReviewHistoryAdmin(ProctoredExamSoftwareSecureReviewAdmin):
"""
The admin panel for SoftwareSecure Review records
Expand Down Expand Up @@ -408,6 +412,7 @@ class Meta:
status = forms.ChoiceField(choices=STATUS_CHOICES)


@admin.register(ProctoredExamStudentAttempt)
class ProctoredExamStudentAttemptAdmin(SimpleHistoryAdmin):
"""
Admin panel for Proctored Exam Attempts
Expand Down Expand Up @@ -495,10 +500,3 @@ def prettify_course_id(course_id):
Prettify the COURSE ID string
"""
return course_id.replace('+', ' ').replace('/', ' ').replace('course-v1:', '')


admin.site.register(ProctoredExam, ProctoredExamAdmin)
admin.site.register(ProctoredExamStudentAttempt, ProctoredExamStudentAttemptAdmin)
admin.site.register(ProctoredExamReviewPolicy, ProctoredExamReviewPolicyAdmin)
admin.site.register(ProctoredExamSoftwareSecureReview, ProctoredExamSoftwareSecureReviewAdmin)
admin.site.register(ProctoredExamSoftwareSecureReviewHistory, ProctoredExamSoftwareSecureReviewHistoryAdmin)
3 changes: 1 addition & 2 deletions edx_proctoring/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,7 @@ def test_get_practice_proctored_exams_for_course(self):
)

self.assertQuerysetEqual(
ProctoredExam.get_practice_proctored_exams_for_course(course_id),
[repr(exam) for exam in practice_proctored_exams]
ProctoredExam.get_practice_proctored_exams_for_course(course_id), list(practice_proctored_exams)
)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@edx/edx-proctoring",
"//": "Note that the version format is slightly different than that of the Python version when using prereleases.",
"version": "4.15.1",
"version": "4.16.0",
"main": "edx_proctoring/static/index.js",
"scripts": {
"test": "gulp test"
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def is_requirement(line):
'Framework :: Django',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.0',
'Framework :: Django :: 4.2',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)',
'Natural Language :: English',
Expand Down
2 changes: 1 addition & 1 deletion test_urls.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@


from django.conf import settings
from django.conf.urls import include

from edx_proctoring import views
from django.urls import include
from django.urls import path, re_path

urlpatterns = [
Expand Down
55 changes: 29 additions & 26 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,80 +1,83 @@
[tox]
envlist =
py38-celery{50}-django{32, 40}-drflatest
quality,
version_check,
pii_check,
translations
envlist =
py38-celery{50}-django{32,40,42}-drflatest
quality,
version_check,
pii_check,
translations
UsamaSadiq marked this conversation as resolved.
Show resolved Hide resolved

[testenv]
deps =
deps =
django32: Django>=3.2,<3.3
django40: Django>=4.0,<4.1
django42: Django>=4.2,<4.3
drflatest: djangorestframework
celery50: -r{toxinidir}/requirements/celery50.txt
-rrequirements/test.txt
commands =
commands =
python -Wd -m pytest {posargs:-n 3}

[testenv:js_tests]
whitelist_externals =
whitelist_externals =
npm
make
commands =
commands =
npm install -g gulp-cli
npm install
make test-js

[testenv:js_lint]
whitelist_externals =
whitelist_externals =
npm
make
commands =
commands =
npm install -g gulp-cli
npm install
make lint-js

[testenv:rst_validation]
whitelist_externals =
whitelist_externals =
make
deps =
deps =
-r{toxinidir}/requirements/quality.txt
commands =
commands =
make quality-rst

[testenv:quality]
whitelist_externals =
whitelist_externals =
make
rm
touch
deps =
deps =
-r{toxinidir}/requirements/quality.txt
-r{toxinidir}/requirements/test.txt
commands =
commands =
pylint edx_proctoring
pycodestyle edx_proctoring
isort --check-only --diff edx_proctoring manage.py setup.py

[testenv:version_check]
deps =
deps =
-r{toxinidir}/requirements/base.txt
commands =
commands =
{toxinidir}/edx_proctoring/scripts/version_check.py

[testenv:pii_check]
whitelist_externals =
whitelist_externals =
make
deps =
deps =
-r{toxinidir}/requirements/test.txt
Django>=3.2,<3.3
commands =
commands =
make pii_check

[testenv:translations]
whitelist_externals =
whitelist_externals =
make
deps =
deps =
UsamaSadiq marked this conversation as resolved.
Show resolved Hide resolved
-rrequirements/test.txt
commands =
commands =
sudo apt-get update
sudo apt-get install --no-install-recommends -y gettext
make validate_translations