diff --git a/django/contrib/auth/__init__.py b/django/contrib/auth/__init__.py index 232a822053..f11f8308e3 100644 --- a/django/contrib/auth/__init__.py +++ b/django/contrib/auth/__init__.py @@ -21,19 +21,10 @@ def load_backend(path): cls = getattr(mod, attr) except AttributeError: raise ImproperlyConfigured('Module "%s" does not define a "%s" authentication backend' % (module, attr)) - if not hasattr(cls, "supports_object_permissions"): - warn("Authentication backends without a `supports_object_permissions` attribute are deprecated. Please define it in %s." % cls, - DeprecationWarning) - cls.supports_object_permissions = False - - if not hasattr(cls, 'supports_anonymous_user'): - warn("Authentication backends without a `supports_anonymous_user` attribute are deprecated. Please define it in %s." % cls, - DeprecationWarning) - cls.supports_anonymous_user = False if not hasattr(cls, 'supports_inactive_user'): warn("Authentication backends without a `supports_inactive_user` attribute are deprecated. Please define it in %s." % cls, - PendingDeprecationWarning) + DeprecationWarning) cls.supports_inactive_user = False return cls() diff --git a/django/contrib/auth/models.py b/django/contrib/auth/models.py index 8a1702ec97..57d4b93e61 100644 --- a/django/contrib/auth/models.py +++ b/django/contrib/auth/models.py @@ -386,13 +386,6 @@ class User(models.Model): raise SiteProfileNotAvailable return self._profile_cache - def _get_message_set(self): - import warnings - warnings.warn('The user messaging API is deprecated. Please update' - ' your code to use the new messages framework.', - category=DeprecationWarning) - return self._message_set - message_set = property(_get_message_set) class Message(models.Model): """ diff --git a/django/contrib/auth/tests/auth_backends.py b/django/contrib/auth/tests/auth_backends.py index 256357a95e..63b65ad521 100644 --- a/django/contrib/auth/tests/auth_backends.py +++ b/django/contrib/auth/tests/auth_backends.py @@ -171,13 +171,9 @@ class RowlevelBackendTest(TestCase): self.user1 = User.objects.create_user('test', 'test@example.com', 'test') self.user2 = User.objects.create_user('test2', 'test2@example.com', 'test') self.user3 = User.objects.create_user('test3', 'test3@example.com', 'test') - self.save_warnings_state() - warnings.filterwarnings('ignore', category=DeprecationWarning, - module='django.contrib.auth') def tearDown(self): settings.AUTHENTICATION_BACKENDS = self.curr_auth - self.restore_warnings_state() # The get_group_permissions test messes with ContentTypes, which will # be cached; flush the cache to ensure there are no side effects # Refs #14975, #14925