1
0
mirror of https://github.com/django/django.git synced 2025-10-25 22:56:12 +00:00

Added conditional skips for all tests dependent on the default User model

This commit is contained in:
Russell Keith-Magee
2012-09-09 01:00:37 +08:00
parent 40ea8b8882
commit 20d1892491
13 changed files with 56 additions and 14 deletions

View File

@@ -6,14 +6,14 @@ from django.contrib.auth.forms import (UserCreationForm, AuthenticationForm,
PasswordChangeForm, SetPasswordForm, UserChangeForm, PasswordResetForm)
from django.core import mail
from django.forms.fields import Field, EmailField
from django.test import TestCase
from django.test import TestCase, skipIfCustomUser
from django.test.utils import override_settings
from django.utils.encoding import force_text
from django.utils import six
from django.utils import translation
from django.utils.translation import ugettext as _
@skipIfCustomUser
@override_settings(USE_TZ=False, PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',))
class UserCreationFormTest(TestCase):
@@ -81,6 +81,7 @@ class UserCreationFormTest(TestCase):
self.assertEqual(repr(u), '<User: jsmith@example.com>')
@skipIfCustomUser
@override_settings(USE_TZ=False, PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',))
class AuthenticationFormTest(TestCase):
@@ -133,6 +134,7 @@ class AuthenticationFormTest(TestCase):
self.assertEqual(form.non_field_errors(), [])
@skipIfCustomUser
@override_settings(USE_TZ=False, PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',))
class SetPasswordFormTest(TestCase):
@@ -160,6 +162,7 @@ class SetPasswordFormTest(TestCase):
self.assertTrue(form.is_valid())
@skipIfCustomUser
@override_settings(USE_TZ=False, PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',))
class PasswordChangeFormTest(TestCase):
@@ -208,6 +211,7 @@ class PasswordChangeFormTest(TestCase):
['old_password', 'new_password1', 'new_password2'])
@skipIfCustomUser
@override_settings(USE_TZ=False, PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',))
class UserChangeFormTest(TestCase):
@@ -255,6 +259,7 @@ class UserChangeFormTest(TestCase):
form.as_table()
@skipIfCustomUser
@override_settings(USE_TZ=False, PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',))
class PasswordResetFormTest(TestCase):