From 015fad9060a8a6fb273a33b8e8457e504ed26131 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Fri, 5 Feb 2016 15:56:52 -0500 Subject: Fixed #26175 -- Removed SHA1 password hashes in tests. --- tests/admin_custom_urls/tests.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'tests/admin_custom_urls/tests.py') 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): """ -- cgit v1.3