summaryrefslogtreecommitdiff
path: root/tests/admin_custom_urls/tests.py
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2016-02-05 15:56:52 -0500
committerTim Graham <timograham@gmail.com>2016-02-06 08:47:21 -0500
commit015fad9060a8a6fb273a33b8e8457e504ed26131 (patch)
treedc56db72ffaea2acbe5925a10c95021f7a26df39 /tests/admin_custom_urls/tests.py
parentf8e865d78f9acb1ad976cffffb207d66ff8cef72 (diff)
Fixed #26175 -- Removed SHA1 password hashes in tests.
Diffstat (limited to 'tests/admin_custom_urls/tests.py')
-rw-r--r--tests/admin_custom_urls/tests.py15
1 files changed, 3 insertions, 12 deletions
diff --git a/tests/admin_custom_urls/tests.py b/tests/admin_custom_urls/tests.py
index 11690e0757..0a78b1afe9 100644
--- a/tests/admin_custom_urls/tests.py
+++ b/tests/admin_custom_urls/tests.py
@@ -1,7 +1,5 @@
from __future__ import unicode_literals
-import datetime
-
from django.contrib.admin.utils import quote
from django.contrib.auth.models import User
from django.template.response import TemplateResponse
@@ -11,8 +9,7 @@ from django.urls import reverse
from .models import Action, Car, Person
-@override_settings(PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
- ROOT_URLCONF='admin_custom_urls.urls',)
+@override_settings(ROOT_URLCONF='admin_custom_urls.urls',)
class AdminCustomUrlsTest(TestCase):
"""
Remember that:
@@ -23,13 +20,7 @@ class AdminCustomUrlsTest(TestCase):
@classmethod
def setUpTestData(cls):
- # password = "secret"
- User.objects.create(
- pk=100, username='super', first_name='Super', last_name='User', email='super@example.com',
- password='sha1$995a3$6011485ea3834267d719b4c801409b8b1ddd0158', is_active=True, is_superuser=True,
- is_staff=True, last_login=datetime.datetime(2007, 5, 30, 13, 20, 10),
- date_joined=datetime.datetime(2007, 5, 30, 13, 20, 10)
- )
+ cls.superuser = User.objects.create_superuser(username='super', password='secret', email='super@example.com')
Action.objects.create(name='delete', description='Remove things.')
Action.objects.create(name='rename', description='Gives things other names.')
Action.objects.create(name='add', description='Add things.')
@@ -44,7 +35,7 @@ class AdminCustomUrlsTest(TestCase):
)
def setUp(self):
- self.client.login(username='super', password='secret')
+ self.client.force_login(self.superuser)
def test_basic_add_GET(self):
"""