summaryrefslogtreecommitdiff
path: root/tests/auth_tests/test_models.py
AgeCommit message (Collapse)Author
2026-05-13Fixed #35514 -- Implemented dictionary-based MAILERS.Mike Edmunds
See DEP 0018. Added: * MAILERS setting. * django.core.mail.mailers dict-like EmailBackend factory. * `using` argument to mail sending APIs. * `sent_using` attribute to mail.outbox messages in locmem backend. * MAILERS in startproject settings template, set to console backend. * AdminLogHandler.using argument. * BrokenLinkEmailsMiddleware.send_mail() method. Updated: * BaseEmailBackend to track the MAILERS alias used to construct it, and to report errors for unknown kwargs (OPTIONS). * EmailBackend implementations to initialize from kwargs (OPTIONS) only when MAILERS is being used. * smtp.EmailBackend to require `host` option and to default `port` option based on SSL/TLS options. * SimpleTestCase setup to substitute the locmem backend for all defined MAILERS configurations. * Django's tests that send mail to define MAILERS. Deprecated: * EMAIL_BACKEND and other backend-related EMAIL_* settings. * mail.get_connection(). * The `connection`, `fail_silently`, `auth_user`, and `auth_password` arguments to mail functions. * The EmailMessage.connection attribute. * BaseEmailBackend support for `fail_silently`. Backends that support fail_silently (SMTP, console, file) now implement it directly. * AdminEmailHandler.email_backend argument. Removed undocumented features without deprecation: * EmailMessage.get_connection() method. (send() now raises an error if a subclass has attempted to override it.) * EmailMessage.send() no longer sets self.connection to the connection used for sending. (It still _uses_ a pre-existing self.connection.) * AdminEmailHandler.connection() method. (Init now raises an error if a subclass has attempted to override it.) Thanks to Natalia Bidart for shepherding DEP 0018 and for extensive reviews and suggestions on the implementation. Thanks to Jacob Rief for the initial implementation and multiple iterations while refining the design. Co-authored-by: Jacob Rief <jacob.rief@gmail.com>
2026-04-07Fixed #37021 -- Added Permission.user_perm_str property.mariatta
For use in checking user permissions via has_perm(). Co-authored-by: 사재혁 <jaehyuck.sa.dev@gmail.com>
2024-10-07Fixed #35303 -- Implemented async auth backends and utils.Jon Janzen
2024-08-13Refs #35402 -- Added tests for invalid usage of submodules in some settings.Jacob Walls
2023-12-31Used addCleanup() in tests where appropriate.Mariusz Felisiak
2023-09-18Refs #33764 -- Removed BaseUserManager.make_random_password() per ↵Mariusz Felisiak
deprecation timeline.
2023-05-18Fixed #34565 -- Added support for async checking of user passwords.HappyDingning
2023-03-09Fixed #33985 -- Used app_config.verbose_name in ContentType.__str__().Hrushikesh Vaidya
2022-11-10Updated documentation and comments for RFC updates.Nick Pope
- Updated references to RFC 1123 to RFC 5322 - Only partial as RFC 5322 sort of sub-references RFC 1123. - Updated references to RFC 2388 to RFC 7578 - Except RFC 2388 Section 5.3 which has no equivalent. - Updated references to RFC 2396 to RFC 3986 - Updated references to RFC 2616 to RFC 9110 - Updated references to RFC 3066 to RFC 5646 - Updated references to RFC 7230 to RFC 9112 - Updated references to RFC 7231 to RFC 9110 - Updated references to RFC 7232 to RFC 9110 - Updated references to RFC 7234 to RFC 9111 - Tidied up style of text when referring to RFC documents
2022-06-03Fixed #33764 -- Deprecated BaseUserManager.make_random_password().Ciaran McCormick
2022-02-22Removed redundant QuerySet.all() calls in docs and tests.Nick Pope
Most QuerySet methods are mapped onto the Manager and, in general, it isn't necessary to call .all() on the manager.
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2020-10-21Fixed #26615 -- Made password reset token invalidate when changing email.Jacob Walls
Co-Authored-By: Silas Barta <sbarta@gmail.com>
2020-08-05Fixed #26977 -- Made abstract models raise TypeError when instantiating.Jacob Walls
2020-07-06Refs #26445 -- Allowed using UserManager.create_user()/create_superuser() in ↵Hasan Ramezani
migrations. Used app config to lookup user model in _create_user(). Thanks Markus Holtermann for the review and initial patch. Thanks Simon Charette for the implementation idea.
2019-08-29Fixed #18763 -- Added ModelBackend/UserManager.with_perm() methods.Berker Peksag
Co-authored-by: Nick Pope <nick.pope@flightdataservices.com>
2019-06-05Refs #30226 -- Added User.get_user_permissions() method.Tobias Bengfort
Added to mirror the existing User.get_group_permissions().
2019-01-10Refs #28478 -- Deprecated TestCase's allow_database_queries and multi_db in ↵Simon Charette
favor of databases.
2018-12-21Added tests for ContentType/Group/Permission.__str__().Tim Graham
2018-11-27Switched TestCase to SimpleTestCase where possible in Django's tests.Tim Graham
2018-09-26Fixed #29782 -- Added better error message when filtering queryset with ↵Ramon Saraiva
AnonymousUser.
2018-09-26Refs #29784 -- Switched to https:// links where available.Jon Dufresne
2018-03-22Fixed #28718 -- Allowed user to request a password reset if their password ↵Tim Graham
doesn't use an enabled hasher. Regression in aeb1389442d0f9669edf6660b747fd10693b63a7. Reverted changes to is_password_usable() from 703c266682be39f7153498ad0d8031231f12ee79 and documentation changes from 92f48680dbd2e02f2b33f6ad0e35b7d337889fb2.
2018-03-02Fixed #29176 -- Fixed AbstractBaseUser.normalize_username() crash if ↵Christophe Mehay
username isn't a string.
2017-09-28Completed test coverage for AnonymousUser.Mads Jensen
2017-09-28Moved AnonymousUser tests to its own test case.Mads Jensen
2017-05-24Refs #27804 -- Used subTest() in several tests.Bruno Alla
2017-03-01Improved test coverage for django.contrib.auth.Anton Samarchyan
2017-01-20Refs #23919 -- Removed django.test.mock Python 2 compatibility shim.Tim Graham
2017-01-18Refs #23919 -- Removed encoding preambles and future importsClaude Paroz
2016-11-10Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings.za
2016-09-27Fixed #20705 -- Allowed using PasswordResetForm with user models with an ↵levental
email field not named 'email'.
2016-09-17Refs #27025 -- Fixed "invalid escape sequence" warnings in Python 3.6.Tim Graham
http://bugs.python.org/issue27364
2016-06-24Fixed #26719 -- Normalized email in AbstractUser.clean().Bang Dao + Tam Huynh
2016-06-21Refs #21379, #26719 -- Moved username normalization to AbstractBaseUser.Tim Graham
Thanks Huynh Thanh Tam for the initial patch and Claude Paroz for review.
2016-06-16Fixed #26747 -- Used more specific assertions in the Django test suite.Jon Dufresne
2016-04-08Fixed E128 flake8 warnings in tests/.Tim Graham
2016-02-06Fixed #26175 -- Removed SHA1 password hashes in tests.Tim Graham
2016-01-29Refs #26022 -- Used context manager version of assertRaisesMessage in tests.Hasan
2015-10-27Removed unnecessary app_label='auth' on auth_tests models.Tim Graham
This is a relic of when the tests were stored in contrib.auth.tests.
2015-07-20Refs #16860 -- Moved password_changed() logic to AbstractBaseUser.Tim Graham
Thanks Carl Meyer for review.
2015-06-22Fixed #25009 -- Allowed User.objects.create_user(...,is_staff=True) to work.Francisco Albarran
2015-03-05Converted test fixtures to setUpTestData methodsJosh Smeaton
2015-02-11Moved non-documented auth test models to the new test location.Tim Graham
2015-02-11Moved contrib.auth tests out of contrib.Tim Graham