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.1 5.0 #126

Merged
merged 10 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 44 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,62 +9,78 @@ jobs:
matrix:
include:
# Django 2.2
- django-version: "2.2.0"
python-version: "3.5"
- django-version: "2.2.0"
python-version: "3.6"
- django-version: "2.2.0"
- django-version: "2.2"
python-version: "3.7"
- django-version: "2.2.0"
- django-version: "2.2"
python-version: "3.8"
- django-version: "2.2.0"
- django-version: "2.2"
python-version: "3.9"

# Django 3.0
- django-version: "3.0.0"
python-version: "3.6"
- django-version: "3.0.0"
- django-version: "3.0"
python-version: "3.7"
- django-version: "3.0.0"
- django-version: "3.0"
python-version: "3.8"
- django-version: "3.0.0"
- django-version: "3.0"
python-version: "3.9"

# Django 3.1
- django-version: "3.1.0"
python-version: "3.6"
- django-version: "3.1.0"
- django-version: "3.1"
python-version: "3.7"
- django-version: "3.1.0"
- django-version: "3.1"
python-version: "3.8"
- django-version: "3.1.0"
- django-version: "3.1"
python-version: "3.9"

# Django 3.2
- django-version: "3.2.0"
python-version: "3.6"
- django-version: "3.2.0"
- django-version: "3.2"
python-version: "3.7"
- django-version: "3.2.0"
- django-version: "3.2"
python-version: "3.8"
- django-version: "3.2.0"
- django-version: "3.2"
python-version: "3.9"
- django-version: "3.2.0"
- django-version: "3.2"
python-version: "3.10"

# Django 4.0
- django-version: "4.0.0"
- django-version: "4.0"
python-version: "3.8"
- django-version: "4.0.0"
- django-version: "4.0"
python-version: "3.9"
- django-version: "4.0.0"
- django-version: "4.0"
python-version: "3.10"

# Django 4.1
- django-version: "4.1"
python-version: "3.8"
- django-version: "4.1"
python-version: "3.9"
- django-version: "4.1"
python-version: "3.10"

# Django 4.2
- django-version: "4.2"
python-version: "3.8"
- django-version: "4.2"
python-version: "3.9"
- django-version: "4.2"
python-version: "3.10"
- django-version: "4.2"
python-version: "3.11"

# Django 5.0
- django-version: "5.0"
python-version: "3.10"
- django-version: "5.0"
python-version: "3.11"
- django-version: "5.0"
python-version: "3.12"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand Down
9 changes: 7 additions & 2 deletions authtools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import pkg_resources
try:
from importlib.metadata import version

__version__ = pkg_resources.get_distribution('django-authtools').version
__version__ = version('django-authtools')
except ImportError:
import pkg_resources

__version__ = pkg_resources.get_distribution('django-authtools').version
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
django-authtools
================

A custom user model app for Django 1.5+. It tries to stay true to the built-in
A custom user model app for Django 2.2+. It tries to stay true to the built-in
User model for the most part. The main differences between authtools and
django.contrib.auth are a User model with email as username.

Expand Down
2 changes: 0 additions & 2 deletions tests/tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@
},
]

# sha1 hasher was removed as a default in django 1.10. Need it for the tests.
PASSWORD_HASHERS = [
'django.contrib.auth.hashers.SHA1PasswordHasher',
'django.contrib.auth.hashers.PBKDF2PasswordHasher',
'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
'django.contrib.auth.hashers.BCryptSHA256PasswordHasher',
Expand Down
6 changes: 3 additions & 3 deletions tests/tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,12 @@ def test_uses_auth_password_validators(self):


@skipIfCustomUser
@override_settings(USE_TZ=False, PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',))
@override_settings(USE_TZ=False)
class UserChangeFormTest(TestCase):
@classmethod
def setUpTestData(cls):
cls.u1 = User.objects.create(
password='sha1$6efc0$f93efe9fd7542f25a7be94871ea45aa95de57161',
password='pbkdf2_sha256$600000$U3$rhq9d758wGq/JU5/+bkG8OqDVY05d04zKD4cuamR+Sk=',
last_login=datetime.datetime(2006, 12, 17, 7, 3, 31), is_superuser=False, username='testclient',
first_name='Test', last_name='Client', email='[email protected]', is_staff=False, is_active=True,
date_joined=datetime.datetime(2006, 12, 17, 7, 3, 31)
Expand Down Expand Up @@ -242,7 +242,7 @@ def test_bug_19133(self):
form = UserChangeForm(instance=user, data=post_data)

self.assertTrue(form.is_valid())
self.assertEqual(form.cleaned_data['password'], 'sha1$6efc0$f93efe9fd7542f25a7be94871ea45aa95de57161')
self.assertEqual(form.cleaned_data['password'], 'pbkdf2_sha256$600000$U3$rhq9d758wGq/JU5/+bkG8OqDVY05d04zKD4cuamR+Sk=')

def test_bug_19349_bound_password_field(self):
user = User.objects.get(username='testclient')
Expand Down
12 changes: 11 additions & 1 deletion tox.ini
bgaudino marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
[tox]
envlist=
py39-dj{22,30,31,32,40}
py{38,39}-dj{22,30,31,32,40,41,42}
py{10}-dj{32,40,41,42,50}
py{11,12}-dj{42,50}
[testenv]
python=
py37: python3.7
py38: python3.8
py39: python3.9
py310: python3.10
py311: python3.11
py312: python3.12
commands=
/usr/bin/env
make test
Expand All @@ -13,6 +20,9 @@ deps=
dj31: Django>=3.1,<3.2
dj32: Django>=3.2,<3.3
dj40: Django>=4.0,<4.1
dj41: Django>=4.1,<4.2
dj42: Django>=4.2,<4.3
dj50: Django>=5.0,<5.1
whitelist_externals=
env
make