diff options
| author | Tim Graham <timograham@gmail.com> | 2015-10-26 18:38:30 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-10-27 08:38:12 -0400 |
| commit | 0b4d11e1751a4e2368f0e4faa121e10ff1f73167 (patch) | |
| tree | 289f619ae1bde9e626e1a4c0a3bcb286898b7c42 /tests/auth_tests | |
| parent | 64a9115bcecf48bce2e7a84d165a6628e2ce607c (diff) | |
[1.9.x] Fixed #25596 -- Fixed regression in password change view with custom user model.
The reverse() added in 50aa1a790ca66c2a93e0a52e00c53375b269ff49
crashed on a custom user model.
Backport of 5acf203db2e9562dbe4073bf85d5043ef3121ea9 from master
Diffstat (limited to 'tests/auth_tests')
| -rw-r--r-- | tests/auth_tests/models/uuid_pk.py | 3 | ||||
| -rw-r--r-- | tests/auth_tests/test_auth_backends.py | 2 | ||||
| -rw-r--r-- | tests/auth_tests/test_views.py | 6 |
3 files changed, 4 insertions, 7 deletions
diff --git a/tests/auth_tests/models/uuid_pk.py b/tests/auth_tests/models/uuid_pk.py index 44ec4410aa..7c65226493 100644 --- a/tests/auth_tests/models/uuid_pk.py +++ b/tests/auth_tests/models/uuid_pk.py @@ -8,6 +8,3 @@ with RemoveGroupsAndPermissions(): class UUIDUser(AbstractUser): """A user with a UUID as primary key""" id = models.UUIDField(default=uuid.uuid4, primary_key=True) - - class Meta: - app_label = 'auth' diff --git a/tests/auth_tests/test_auth_backends.py b/tests/auth_tests/test_auth_backends.py index 35b3cf893c..d8b2f43153 100644 --- a/tests/auth_tests/test_auth_backends.py +++ b/tests/auth_tests/test_auth_backends.py @@ -292,7 +292,7 @@ class CustomUserModelBackendAuthenticateTest(TestCase): self.assertEqual(test_user, authenticated_user) -@override_settings(AUTH_USER_MODEL='auth.UUIDUser') +@override_settings(AUTH_USER_MODEL='auth_tests.UUIDUser') class UUIDUserTests(TestCase): def test_login(self): diff --git a/tests/auth_tests/test_views.py b/tests/auth_tests/test_views.py index 723b20a812..d5697d85e7 100644 --- a/tests/auth_tests/test_views.py +++ b/tests/auth_tests/test_views.py @@ -420,7 +420,7 @@ class CustomUserPasswordResetTest(AuthViewsTestCase): self.assertRedirects(response, '/reset/done/') -@override_settings(AUTH_USER_MODEL='auth.UUIDUser') +@override_settings(AUTH_USER_MODEL='auth_tests.UUIDUser') class UUIDUserPasswordResetTest(CustomUserPasswordResetTest): def _test_confirm_start(self): @@ -1005,7 +1005,7 @@ class ChangelistTests(AuthViewsTestCase): @override_settings( - AUTH_USER_MODEL='auth.UUIDUser', + AUTH_USER_MODEL='auth_tests.UUIDUser', ROOT_URLCONF='auth_tests.urls_custom_user_admin', ) class UUIDUserTests(TestCase): @@ -1014,7 +1014,7 @@ class UUIDUserTests(TestCase): u = UUIDUser.objects.create_superuser(username='uuid', email='foo@bar.com', password='test') self.assertTrue(self.client.login(username='uuid', password='test')) - user_change_url = reverse('custom_user_admin:auth_uuiduser_change', args=(u.pk,)) + user_change_url = reverse('custom_user_admin:auth_tests_uuiduser_change', args=(u.pk,)) response = self.client.get(user_change_url) self.assertEqual(response.status_code, 200) |
