Removed unnecessary app_label='auth' on auth_tests models.

This is a relic of when the tests were stored in contrib.auth.tests.
This commit is contained in:
Tim Graham 2015-10-26 18:43:42 -04:00
parent 5acf203db2
commit 590b8c1c57
7 changed files with 9 additions and 30 deletions

View File

@ -30,9 +30,6 @@ with RemoveGroupsAndPermissions():
USERNAME_FIELD = 'email' USERNAME_FIELD = 'email'
REQUIRED_FIELDS = ['date_of_birth'] REQUIRED_FIELDS = ['date_of_birth']
class Meta:
app_label = 'auth'
def get_full_name(self): def get_full_name(self):
return self.email return self.email

View File

@ -19,9 +19,6 @@ class CustomUserNonUniqueUsername(AbstractBaseUser):
objects = UserManager() objects = UserManager()
class Meta:
app_label = 'auth'
class CustomUserNonListRequiredFields(AbstractBaseUser): class CustomUserNonListRequiredFields(AbstractBaseUser):
"A user with a non-list REQUIRED_FIELDS" "A user with a non-list REQUIRED_FIELDS"
@ -31,9 +28,6 @@ class CustomUserNonListRequiredFields(AbstractBaseUser):
USERNAME_FIELD = 'username' USERNAME_FIELD = 'username'
REQUIRED_FIELDS = 'date_of_birth' REQUIRED_FIELDS = 'date_of_birth'
class Meta:
app_label = 'auth'
class CustomUserBadRequiredFields(AbstractBaseUser): class CustomUserBadRequiredFields(AbstractBaseUser):
"A user with a USERNAME_FIELD that appears in REQUIRED_FIELDS (invalid)" "A user with a USERNAME_FIELD that appears in REQUIRED_FIELDS (invalid)"
@ -42,6 +36,3 @@ class CustomUserBadRequiredFields(AbstractBaseUser):
USERNAME_FIELD = 'username' USERNAME_FIELD = 'username'
REQUIRED_FIELDS = ['username', 'date_of_birth'] REQUIRED_FIELDS = ['username', 'date_of_birth']
class Meta:
app_label = 'auth'

View File

@ -12,7 +12,4 @@ class IsActiveTestUser1(AbstractBaseUser):
USERNAME_FIELD = 'username' USERNAME_FIELD = 'username'
class Meta:
app_label = 'auth'
# the is_active attr is provided by AbstractBaseUser # the is_active attr is provided by AbstractBaseUser

View File

@ -5,9 +5,6 @@ from django.db import models
class Email(models.Model): class Email(models.Model):
email = models.EmailField(verbose_name='email address', max_length=255, unique=True) email = models.EmailField(verbose_name='email address', max_length=255, unique=True)
class Meta:
app_label = 'auth'
class CustomUserWithFKManager(BaseUserManager): class CustomUserWithFKManager(BaseUserManager):
def create_superuser(self, username, email, group, password): def create_superuser(self, username, email, group, password):
@ -26,6 +23,3 @@ class CustomUserWithFK(AbstractBaseUser):
USERNAME_FIELD = 'username' USERNAME_FIELD = 'username'
REQUIRED_FIELDS = ['email', 'group'] REQUIRED_FIELDS = ['email', 'group']
class Meta:
app_label = 'auth'

View File

@ -250,7 +250,7 @@ class ExtensionUserModelBackendTest(BaseModelBackendTest, TestCase):
) )
@override_settings(AUTH_USER_MODEL='auth.CustomPermissionsUser') @override_settings(AUTH_USER_MODEL='auth_tests.CustomPermissionsUser')
class CustomPermissionsUserModelBackendTest(BaseModelBackendTest, TestCase): class CustomPermissionsUserModelBackendTest(BaseModelBackendTest, TestCase):
""" """
Tests for the ModelBackend using the CustomPermissionsUser model. Tests for the ModelBackend using the CustomPermissionsUser model.

View File

@ -327,7 +327,7 @@ class CreatesuperuserManagementCommandTestCase(TestCase):
self.assertEqual(CustomUser._default_manager.count(), 0) self.assertEqual(CustomUser._default_manager.count(), 0)
@override_settings( @override_settings(
AUTH_USER_MODEL='auth.CustomUserNonUniqueUsername', AUTH_USER_MODEL='auth_tests.CustomUserNonUniqueUsername',
AUTHENTICATION_BACKENDS=['my.custom.backend'], AUTHENTICATION_BACKENDS=['my.custom.backend'],
) )
def test_swappable_user_username_non_unique(self): def test_swappable_user_username_non_unique(self):
@ -406,7 +406,7 @@ class CreatesuperuserManagementCommandTestCase(TestCase):
) )
self.assertIs(command.stdin, sys.stdin) self.assertIs(command.stdin, sys.stdin)
@override_settings(AUTH_USER_MODEL='auth.CustomUserWithFK') @override_settings(AUTH_USER_MODEL='auth_tests.CustomUserWithFK')
def test_fields_with_fk(self): def test_fields_with_fk(self):
new_io = six.StringIO() new_io = six.StringIO()
group = Group.objects.create(name='mygroup') group = Group.objects.create(name='mygroup')
@ -436,7 +436,7 @@ class CreatesuperuserManagementCommandTestCase(TestCase):
stdout=new_io, stdout=new_io,
) )
@override_settings(AUTH_USER_MODEL='auth.CustomUserWithFK') @override_settings(AUTH_USER_MODEL='auth_tests.CustomUserWithFK')
def test_fields_with_fk_interactive(self): def test_fields_with_fk_interactive(self):
new_io = six.StringIO() new_io = six.StringIO()
group = Group.objects.create(name='mygroup') group = Group.objects.create(name='mygroup')
@ -566,7 +566,7 @@ class CreatesuperuserManagementCommandTestCase(TestCase):
class CustomUserModelValidationTestCase(SimpleTestCase): class CustomUserModelValidationTestCase(SimpleTestCase):
@override_settings(AUTH_USER_MODEL='auth.CustomUserNonListRequiredFields') @override_settings(AUTH_USER_MODEL='auth_tests.CustomUserNonListRequiredFields')
@override_system_checks([check_user_model]) @override_system_checks([check_user_model])
def test_required_fields_is_list(self): def test_required_fields_is_list(self):
"REQUIRED_FIELDS should be a list." "REQUIRED_FIELDS should be a list."
@ -581,7 +581,7 @@ class CustomUserModelValidationTestCase(SimpleTestCase):
] ]
self.assertEqual(errors, expected) self.assertEqual(errors, expected)
@override_settings(AUTH_USER_MODEL='auth.CustomUserBadRequiredFields') @override_settings(AUTH_USER_MODEL='auth_tests.CustomUserBadRequiredFields')
@override_system_checks([check_user_model]) @override_system_checks([check_user_model])
def test_username_not_in_required_fields(self): def test_username_not_in_required_fields(self):
"USERNAME_FIELD should not appear in REQUIRED_FIELDS." "USERNAME_FIELD should not appear in REQUIRED_FIELDS."
@ -597,7 +597,7 @@ class CustomUserModelValidationTestCase(SimpleTestCase):
] ]
self.assertEqual(errors, expected) self.assertEqual(errors, expected)
@override_settings(AUTH_USER_MODEL='auth.CustomUserNonUniqueUsername') @override_settings(AUTH_USER_MODEL='auth_tests.CustomUserNonUniqueUsername')
@override_system_checks([check_user_model]) @override_system_checks([check_user_model])
def test_username_non_unique(self): def test_username_non_unique(self):
"A non-unique USERNAME_FIELD should raise a model validation error." "A non-unique USERNAME_FIELD should raise a model validation error."
@ -613,7 +613,7 @@ class CustomUserModelValidationTestCase(SimpleTestCase):
] ]
self.assertEqual(errors, expected) self.assertEqual(errors, expected)
@override_settings(AUTH_USER_MODEL='auth.CustomUserNonUniqueUsername', @override_settings(AUTH_USER_MODEL='auth_tests.CustomUserNonUniqueUsername',
AUTHENTICATION_BACKENDS=[ AUTHENTICATION_BACKENDS=[
'my.custom.backend', 'my.custom.backend',
]) ])

View File

@ -269,7 +269,7 @@ class IsActiveTestCase(TestCase):
# the is_active flag is saved # the is_active flag is saved
self.assertFalse(user_fetched.is_active) self.assertFalse(user_fetched.is_active)
@override_settings(AUTH_USER_MODEL='auth.IsActiveTestUser1') @override_settings(AUTH_USER_MODEL='auth_tests.IsActiveTestUser1')
def test_is_active_field_default(self): def test_is_active_field_default(self):
""" """
tests that the default value for is_active is provided tests that the default value for is_active is provided