Commit 8fad77da authored by Anssi Kääriäinen's avatar Anssi Kääriäinen
Browse files

Ensured tests pass using custom PASSWORD_HASHERS.

parent 2a094047
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@ from django.test.utils import override_settings
            os.path.join(os.path.dirname(__file__), 'templates'),
        ),
    USE_TZ=False,                           # required for loading the fixture
    PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
)
class AuthContextProcessorTests(TestCase):
    """
+6 −6
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ from django.utils import translation
from django.utils.translation import ugettext as _


@override_settings(USE_TZ=False)
@override_settings(USE_TZ=False, PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',))
class UserCreationFormTest(TestCase):

    fixtures = ['authtestdata.json']
@@ -77,7 +77,7 @@ class UserCreationFormTest(TestCase):
        self.assertEqual(repr(u), '<User: jsmith@example.com>')


@override_settings(USE_TZ=False)
@override_settings(USE_TZ=False, PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',))
class AuthenticationFormTest(TestCase):

    fixtures = ['authtestdata.json']
@@ -129,7 +129,7 @@ class AuthenticationFormTest(TestCase):
        self.assertEqual(form.non_field_errors(), [])


@override_settings(USE_TZ=False)
@override_settings(USE_TZ=False, PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',))
class SetPasswordFormTest(TestCase):

    fixtures = ['authtestdata.json']
@@ -156,7 +156,7 @@ class SetPasswordFormTest(TestCase):
        self.assertTrue(form.is_valid())


@override_settings(USE_TZ=False)
@override_settings(USE_TZ=False, PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',))
class PasswordChangeFormTest(TestCase):

    fixtures = ['authtestdata.json']
@@ -204,7 +204,7 @@ class PasswordChangeFormTest(TestCase):
                         ['old_password', 'new_password1', 'new_password2'])


@override_settings(USE_TZ=False)
@override_settings(USE_TZ=False, PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',))
class UserChangeFormTest(TestCase):

    fixtures = ['authtestdata.json']
@@ -251,7 +251,7 @@ class UserChangeFormTest(TestCase):
        form.as_table()


@override_settings(USE_TZ=False)
@override_settings(USE_TZ=False, PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',))
class PasswordResetFormTest(TestCase):

    fixtures = ['authtestdata.json']
+1 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@ from django.test.utils import override_settings
from django.contrib.auth import signals


@override_settings(USE_TZ=False)
@override_settings(USE_TZ=False, PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',))
class SignalTestCase(TestCase):
    urls = 'django.contrib.auth.tests.urls'
    fixtures = ['authtestdata.json']
+1 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ from django.contrib.auth.forms import (AuthenticationForm, PasswordChangeForm,
        os.path.join(os.path.dirname(__file__), 'templates'),
    ),
    USE_TZ=False,
    PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
)
class AuthViewsTestCase(TestCase):
    """
+2 −1
Original line number Diff line number Diff line
@@ -25,10 +25,11 @@ from __future__ import absolute_import
from django.conf import settings
from django.core import mail
from django.test import Client, TestCase, RequestFactory
from django.test.utils import override_settings

from .views import get_view


@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',))
class ClientTest(TestCase):
    fixtures = ['testdata.json']

Loading