Loading docs/releases/1.10.txt +7 −0 Original line number Diff line number Diff line Loading @@ -448,6 +448,13 @@ output:: } } ``auth.CustomUser`` and ``auth.ExtensionUser`` test models were removed. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Since the introduction of migrations for the contrib apps in Django 1.8, the tables of these custom user test models were not created anymore making them unusable in a testing context. Miscellaneous ~~~~~~~~~~~~~ Loading tests/auth_tests/models/__init__.py +4 −2 Original line number Diff line number Diff line from .custom_permissions import CustomPermissionsUser from .custom_user import CustomUser, ExtensionUser from .invalid_models import CustomUserNonUniqueUsername from .is_active import IsActiveTestUser1 from .uuid_pk import UUIDUser from .with_foreign_key import CustomUserWithFK, Email __all__ = ( 'CustomPermissionsUser', 'CustomUserWithFK', 'Email', 'IsActiveTestUser1', 'UUIDUser', 'CustomUserNonUniqueUsername', 'CustomUser', 'CustomPermissionsUser', 'CustomUserWithFK', 'Email', 'ExtensionUser', 'IsActiveTestUser1', 'UUIDUser', 'CustomUserNonUniqueUsername', ) tests/auth_tests/models/custom_permissions.py +2 −3 Original line number Diff line number Diff line Loading @@ -4,12 +4,11 @@ Django permissions model. This allows us to check that the PermissionsMixin includes everything that is needed to interact with the ModelBackend. """ from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin from django.contrib.auth.tests.custom_user import ( CustomUserManager, RemoveGroupsAndPermissions, ) from django.db import models from django.utils.encoding import python_2_unicode_compatible from .custom_user import CustomUserManager, RemoveGroupsAndPermissions class CustomPermissionsUserManager(CustomUserManager): def create_superuser(self, email, password, date_of_birth): Loading django/contrib/auth/tests/custom_user.py→tests/auth_tests/models/custom_user.py +0 −6 Original line number Diff line number Diff line Loading @@ -43,9 +43,6 @@ class CustomUser(AbstractBaseUser): USERNAME_FIELD = 'email' REQUIRED_FIELDS = ['date_of_birth'] class Meta: app_label = 'auth' def get_full_name(self): return self.email Loading Loading @@ -108,6 +105,3 @@ with RemoveGroupsAndPermissions(): custom_objects = UserManager() REQUIRED_FIELDS = AbstractUser.REQUIRED_FIELDS + ['date_of_birth'] class Meta: app_label = 'auth' tests/auth_tests/models/uuid_pk.py +2 −1 Original line number Diff line number Diff line import uuid from django.contrib.auth.models import AbstractUser from django.contrib.auth.tests.custom_user import RemoveGroupsAndPermissions from django.db import models from .custom_user import RemoveGroupsAndPermissions with RemoveGroupsAndPermissions(): class UUIDUser(AbstractUser): """A user with a UUID as primary key""" Loading Loading
docs/releases/1.10.txt +7 −0 Original line number Diff line number Diff line Loading @@ -448,6 +448,13 @@ output:: } } ``auth.CustomUser`` and ``auth.ExtensionUser`` test models were removed. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Since the introduction of migrations for the contrib apps in Django 1.8, the tables of these custom user test models were not created anymore making them unusable in a testing context. Miscellaneous ~~~~~~~~~~~~~ Loading
tests/auth_tests/models/__init__.py +4 −2 Original line number Diff line number Diff line from .custom_permissions import CustomPermissionsUser from .custom_user import CustomUser, ExtensionUser from .invalid_models import CustomUserNonUniqueUsername from .is_active import IsActiveTestUser1 from .uuid_pk import UUIDUser from .with_foreign_key import CustomUserWithFK, Email __all__ = ( 'CustomPermissionsUser', 'CustomUserWithFK', 'Email', 'IsActiveTestUser1', 'UUIDUser', 'CustomUserNonUniqueUsername', 'CustomUser', 'CustomPermissionsUser', 'CustomUserWithFK', 'Email', 'ExtensionUser', 'IsActiveTestUser1', 'UUIDUser', 'CustomUserNonUniqueUsername', )
tests/auth_tests/models/custom_permissions.py +2 −3 Original line number Diff line number Diff line Loading @@ -4,12 +4,11 @@ Django permissions model. This allows us to check that the PermissionsMixin includes everything that is needed to interact with the ModelBackend. """ from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin from django.contrib.auth.tests.custom_user import ( CustomUserManager, RemoveGroupsAndPermissions, ) from django.db import models from django.utils.encoding import python_2_unicode_compatible from .custom_user import CustomUserManager, RemoveGroupsAndPermissions class CustomPermissionsUserManager(CustomUserManager): def create_superuser(self, email, password, date_of_birth): Loading
django/contrib/auth/tests/custom_user.py→tests/auth_tests/models/custom_user.py +0 −6 Original line number Diff line number Diff line Loading @@ -43,9 +43,6 @@ class CustomUser(AbstractBaseUser): USERNAME_FIELD = 'email' REQUIRED_FIELDS = ['date_of_birth'] class Meta: app_label = 'auth' def get_full_name(self): return self.email Loading Loading @@ -108,6 +105,3 @@ with RemoveGroupsAndPermissions(): custom_objects = UserManager() REQUIRED_FIELDS = AbstractUser.REQUIRED_FIELDS + ['date_of_birth'] class Meta: app_label = 'auth'
tests/auth_tests/models/uuid_pk.py +2 −1 Original line number Diff line number Diff line import uuid from django.contrib.auth.models import AbstractUser from django.contrib.auth.tests.custom_user import RemoveGroupsAndPermissions from django.db import models from .custom_user import RemoveGroupsAndPermissions with RemoveGroupsAndPermissions(): class UUIDUser(AbstractUser): """A user with a UUID as primary key""" Loading