diff options
| author | Tim Graham <timograham@gmail.com> | 2013-08-28 20:03:21 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-08-29 06:36:35 -0400 |
| commit | cf8d6e910839238ee9b2d0a094d98cb8d48dc530 (patch) | |
| tree | c58d063cdb366f2cb641912f04b76a672984177e /tests | |
| parent | 8d473b2c54035cbcd3aacef0cb83a9769cd05ad3 (diff) | |
Fixed #20881 -- Removed contrib.auth.models.AbstractUser.get_absolute_url()
The definition is arbitrary and creates a broken "view on site"
link in the admin if a project doesn't define such a URL.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/admin_views/tests.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index 66a5735b6c..2b4ed7b3f5 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -1749,9 +1749,9 @@ class SecureViewTests(TestCase): """ Only admin users should be able to use the admin shortcut view. """ - user_ctype = ContentType.objects.get_for_model(User) - user = User.objects.get(username='super') - shortcut_url = "/test_admin/admin/r/%s/%s/" % (user_ctype.pk, user.pk) + model_ctype = ContentType.objects.get_for_model(ModelWithStringPrimaryKey) + obj = ModelWithStringPrimaryKey.objects.create(string_pk='foo') + shortcut_url = "/test_admin/admin/r/%s/%s/" % (model_ctype.pk, obj.pk) # Not logged in: we should see the login page. response = self.client.get(shortcut_url, follow=False) @@ -1762,7 +1762,7 @@ class SecureViewTests(TestCase): response = self.client.get(shortcut_url, follow=False) # Can't use self.assertRedirects() because User.get_absolute_url() is silly. self.assertEqual(response.status_code, 302) - self.assertEqual(response.url, 'http://example.com/users/super/') + self.assertEqual(response.url, 'http://example.com/dummy/foo/') @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) |
