Skip to content

Commit

Permalink
Added Django 4 support
Browse files Browse the repository at this point in the history
  • Loading branch information
mongkok committed Aug 3, 2023
1 parent 5606274 commit ea3a76e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ jobs:
runs-on: ubuntu-18.04
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9']
django-version: ['2.0', '2.1', '2.2', '3.0', '3.1', '3.2']
python-version: ['3.8', '3.9', '3.10']
django-version: ['3.0', '3.1', '3.2', '4.0', '4.1', '4.2']

steps:
- uses: actions/checkout@v2
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,18 @@ classifiers = [
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Framework :: Django",
"Framework :: Django :: 2.0",
"Framework :: Django :: 2.1",
"Framework :: Django :: 2.2",
"Framework :: Django :: 3.0",
"Framework :: Django :: 3.1",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.0",
"Framework :: Django :: 4.1",
"Framework :: Django :: 4.2",
"Topic :: Security",
"Topic :: Software Development",
"Topic :: Software Development :: Libraries",
Expand Down
5 changes: 4 additions & 1 deletion tests/test_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,7 @@ def test_csrf_rotation(self):
lambda cls, root, info, *args, **kwargs: None,
)(self, None, info_mock)

self.assertTrue(info_mock.context.csrf_cookie_needs_reset)
if django.VERSION >= (4,):
self.assertTrue(info_mock.context.META["CSRF_COOKIE_NEEDS_UPDATE"])
else:
self.assertTrue(info_mock.context.csrf_cookie_needs_reset)

0 comments on commit ea3a76e

Please sign in to comment.