Skip to content

Commit

Permalink
Merge pull request #199 from openedx/salman/django-4.2-update
Browse files Browse the repository at this point in the history
fix: update for django 4.2, update changelog.
  • Loading branch information
awais786 authored Jun 23, 2023
2 parents 02e3c51 + 4f2cf2f commit df1bb9e
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
matrix:
os: [ubuntu-20.04]
python-version: ['3.8']
toxenv: [quality, docs, pii_check, django32, django40]
toxenv: [quality, docs, pii_check, django32, django40, django42]

steps:
- uses: actions/checkout@v2
Expand All @@ -36,7 +36,7 @@ jobs:
run: tox

- name: Run Coverage
if: matrix.python-version == '3.8' && matrix.toxenv=='django32'
if: matrix.python-version == '3.8' && matrix.toxenv=='django42'
uses: codecov/codecov-action@v1
with:
flags: unittests
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Unreleased
* Switch from ``edx-sphinx-theme`` to ``sphinx-book-theme`` since the former is
deprecated

[2.4.0] - 2023-06-21
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Support added for Django 4.2

[2.3.0] - 2022-02-15
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Added Django40 support
Expand Down
4 changes: 1 addition & 3 deletions edx_when/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@
Central source of course block dates for the LMS.
"""

__version__ = '2.3.0'

default_app_config = 'edx_when.apps.EdxWhenConfig' # pylint: disable=invalid-name
__version__ = '2.4.0'
4 changes: 2 additions & 2 deletions edx_when/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"""

from django.conf import settings
from django.conf.urls import url
from django.urls import re_path

from . import views

app_name = 'edx_when'

urlpatterns = [
url(
re_path(
r'edx_when/course/{}'.format(settings.COURSE_ID_PATTERN),
views.CourseDates.as_view(),
name='course_dates'
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,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
8 changes: 8 additions & 0 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import ddt
from django.contrib import auth
from django.test import TestCase
from django.urls import reverse
from edx_django_utils.cache.utils import TieredCache
from opaque_keys.edx.locator import CourseLocator

Expand Down Expand Up @@ -577,6 +578,13 @@ def test_set_date_for_block_query_counts(self):
with self.assertNumQueries(1):
api.set_date_for_block(*args)

def test_api_view(self):
"""
This test just for meeting code-coverage.
"""
response = self.client.get(reverse('course_dates'))
self.assertEqual(response.status_code, 403)


class ApiWaffleTests(TestCase):
"""
Expand Down
29 changes: 15 additions & 14 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py38-django{32,40}, pii_check, quality, docs
envlist = py38-django{32,40,42}, pii_check, quality, docs

[doc8]
max-line-length = 120
Expand All @@ -18,24 +18,25 @@ addopts = --cov edx_when --cov-report term-missing --cov-report xml
norecursedirs = .* docs requirements

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

[testenv:docs]
setenv =
setenv =
DJANGO_SETTINGS_MODULE = test_settings
PYTHONPATH = {toxinidir}
whitelist_externals =
whitelist_externals =
make
rm
twine
deps =
deps =
-r{toxinidir}/requirements/doc.txt
commands =
commands =
doc8 --ignore-path docs/_build README.rst docs
rm -f docs/edx_when.rst
rm -f docs/modules.rst
Expand All @@ -45,16 +46,16 @@ commands =
twine check dist/*

[testenv:quality]
setenv =
setenv =
DJANGO_SETTINGS_MODULE = test_settings
PYTHONPATH = {toxinidir}
whitelist_externals =
whitelist_externals =
make
rm
touch
deps =
deps =
-r{toxinidir}/requirements/quality.txt
commands =
commands =
touch tests/__init__.py
pylint edx_when tests test_utils manage.py setup.py
rm tests/__init__.py
Expand All @@ -64,11 +65,11 @@ commands =
make selfcheck

[testenv:pii_check]
setenv =
setenv =
DJANGO_SETTINGS_MODULE = test_settings
deps =
deps =
-r{toxinidir}/requirements/test.txt
django32: Django>=3.2,<4.0
commands =
commands =
code_annotations django_find_annotations --config_file .pii_annotations.yml --lint --report --coverage

0 comments on commit df1bb9e

Please sign in to comment.