summaryrefslogtreecommitdiff
path: root/tests/managers_regress
Commit message (Collapse)AuthorAgeFilesLines
* Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak2022-02-071-1/+2
|
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-072-45/+59
|
* Fixed #32355 -- Dropped support for Python 3.6 and 3.7Mariusz Felisiak2021-02-101-4/+0
|
* Fixed #31235 -- Made assertQuerysetEqual() compare querysets directly.Hasan Ramezani2020-11-061-32/+30
| | | | | | | | This also replaces assertQuerysetEqual() to assertSequenceEqual()/assertCountEqual() where appropriate. Co-authored-by: Peter Inglesby <peter.inglesby@gmail.com> Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
* Fixed #31223 -- Added __class_getitem__() to Manager and QuerySet.sobolevn2020-04-151-0/+7
|
* Switched TestCase to SimpleTestCase where possible in Django's tests.Tim Graham2018-11-271-2/+2
|
* Fixed #29227 -- Allowed BooleanField to be null=True.Tim Graham2018-03-201-1/+1
| | | | Thanks Lynn Cyrin for contributing to the patch, and Nick Pope for review.
* Fixed #28776 -- Fixed a/an/and typos in docs and comments.Дилян Палаузов2017-11-061-1/+1
|
* Refs #23919 -- Replaced super(ClassName, self) with super().chillaranand2017-01-251-3/+3
|
* Removed unneeded force_text calls in the test suiteClaude Paroz2017-01-242-5/+3
|
* Refs #23919 -- Removed python_2_unicode_compatible decorator usageClaude Paroz2017-01-181-9/+1
|
* Refs #23919 -- Removed encoding preambles and future importsClaude Paroz2017-01-181-2/+0
|
* Removed Manager.use_for_related_fields and Meta.manager_inheritance_from_future.Tim Graham2017-01-172-361/+6
| | | | Per deprecation timeline. Refs ed0ff913c648b16c4471fc9a9441d1ee48cb5420.
* Removed GeoManager and GeoQuerySet per deprecation timeline.Tim Graham2017-01-171-13/+0
|
* Fixed #27073 -- Removed duplicated managers in `Model._meta.managers`.Loïc Bistuer2016-08-191-0/+16
|
* Fixed #26749 -- Preserved behavior of use_for_related_field during deprecation.Julien Hartmann2016-07-111-3/+94
|
* Fixed #10506, #13793, #14891, #25201 -- Introduced new APIs to specify ↵Loïc Bistuer2016-05-172-0/+389
| | | | | | | | | | | | | | | | | | | | | | | | | | | models' default and base managers. This deprecates use_for_related_fields. Old API: class CustomManager(models.Model): use_for_related_fields = True class Model(models.Model): custom_manager = CustomManager() New API: class Model(models.Model): custom_manager = CustomManager() class Meta: base_manager_name = 'custom_manager' Refs #20932, #25897. Thanks Carl Meyer for the guidance throughout this work. Thanks Tim Graham for writing the docs.
* Fixed #20932, #25897 -- Streamlined manager inheritance.Loïc Bistuer2016-05-172-4/+2
|
* Cosmetic edits to tests/managers_regress/tests.pyTim Graham2016-05-131-13/+6
|
* Fixed #25746 -- Isolated inlined test models registration.Simon Charette2016-01-061-70/+46
| | | | Thanks to Tim for the review.
* Fixed #21127 -- Started deprecation toward requiring on_delete for ↵Flavio Curella2015-07-271-2/+2
| | | | ForeignKey/OneToOneField
* Used assertRaisesMessage in managers_regress tests.Tim Graham2015-07-021-16/+10
|
* Fixed #25054 -- Added app_label to swapped model AttributeErrorChris Lamb2015-07-021-17/+15
|
* Sorted imports with isort; refs #23860.Tim Graham2015-02-062-14/+4
|
* Fixed #23940 -- Allowed model fields to be named `exact`.Simon Charette2015-01-292-2/+11
| | | | | | | | An explicit `__exact` lookup in the related managers filters was interpreted as a reference to a foreign `exact` field. Thanks to Trac alias zhiyajun11 for the report, Josh for the investigation, Loïc for the test name and Tim for the review.
* Fixed #19774 -- Deprecated the contenttypes.generic module.Simon Charette2014-01-261-4/+6
| | | | | | | It contained models, forms and admin objects causing undesirable import side effects. Refs #16368. Thanks to Ramiro, Carl and Loïc for the review.
* Used Apps.clear_cache() in tests that alter the app registry.Aymeric Augustin2013-12-291-3/+3
|
* Renamed AppCache to Apps.Aymeric Augustin2013-12-241-13/+13
| | | | | | Also renamed app_cache to apps and "app cache" to "app registry". Deprecated AppCache.app_cache_ready() in favor of Apps.ready().
* Replaced ad-hoc caching of get_models with lru_cache.Aymeric Augustin2013-12-241-3/+3
| | | | | Invalidate properly the cache whenever all_models or app_configs change. This fixes some isolation issues in the test suite.
* Imported override_settings from its new location.Aymeric Augustin2013-12-231-2/+1
|
* Moved apps back in the toplevel django namespace.Aymeric Augustin2013-12-221-1/+1
| | | | Reverted 4a56a93cc458e9ab4dcab95d9f5067d4975dd1a2.
* Refactored registration of models.Aymeric Augustin2013-12-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | Got rid of AppConfig._stub. As a side effect, app_cache.app_configs now only contains entries for applications that are in INSTALLED_APPS, which is a good thing and will allow dramatic simplifications (which I will perform in the next commit). That required adjusting all methods that iterate on app_configs without checking the "installed" flag, hence the large changes in get_model[s]. Introduced AppCache.all_models to store models: - while the app cache is being populated and a suitable app config object to register models isn't available yet; - for applications that aren't in INSTALLED_APPS since they don't have an app config any longer. Replaced get_model(seed_cache=False) by registered_model() which can be kept simple and safe to call at any time, and removed the seed_cache argument to get_model[s]. There's no replacement for that private API. Allowed non-master app caches to go through populate() as it is now safe to do so. They were introduced in 1.7 so backwards compatibility isn't a concern as long as the migrations framework keeps working.
* Moved the new app cache inside core.Aymeric Augustin2013-12-171-1/+1
|
* Moved list of models inside AppConfig instances.Aymeric Augustin2013-12-171-19/+18
| | | | | | | | | | | | | | | | | | | | | | | This commit is a refactoring with no change of functionality, according to the following invariants: - An app_label that was in app_configs and app_models stays in app_config and has its 'installed' attribute set to True. - An app_label that was in app_models but not in app_configs is added to app_configs and has its 'installed' attribute set to True. As a consequence, all the code that iterated on app_configs is modified to check for the 'installed' attribute. Code that iterated on app_models is rewritten in terms of app_configs. Many tests that stored and restored the state of the app cache were updated. In the long term, we should reconsider the usefulness of allowing importing models from non-installed applications. This doesn't sound particularly useful, can be a trap in some circumstances, and causes significant complexity in sensitive areas of Django.
* Removed module-level functions for the app cache.Aymeric Augustin2013-12-171-7/+7
| | | | | | | | | | | | | | | Since the original ones in django.db.models.loading were kept only for backwards compatibility, there's no need to recreate them. However, many internals of Django still relied on them. They were also imported in django.db.models. They never appear in the documentation, except a quick mention of get_models and get_app in the 1.2 release notes to document an edge case in GIS. I don't think that makes them a public API. This commit doesn't change the overall amount of global state but clarifies that it's tied to the app_cache object instead of hiding it behind half a dozen functions.
* Removed BaseAppCache.app_store.Aymeric Augustin2013-12-171-6/+0
| | | | | It was only storing redundant information. This is part of the effort to allow applications without a models module.
* Moved django.db.models.loading to django.apps.cache.Aymeric Augustin2013-12-171-1/+1
| | | | This commit doesn't contain any code changes; it's purely a refactoring.
* Fixed #21302 -- Fixed unused imports and import *.Tim Graham2013-11-021-1/+0
|
* Removed some direct settings manipulations in tests; refs #21230.Bouke Haarsma2013-10-211-9/+4
|
* Fixed #21288 -- Fixed E126 pep8 warningsAlasdair Nicol2013-10-211-8/+8
|
* Fixed #21287 -- Fixed E123 pep8 warningsAlasdair Nicol2013-10-181-3/+3
|
* Fixed #3871 -- Fixed regression introduced by 04a2a6b.Loic Bistuer2013-09-302-2/+46
| | | | | | | Added do_not_call_in_templates=True attribute to RelatedManagers to prevent them from being called. Thanks jbg@ for the report.
* Removed most of absolute_import importsClaude Paroz2013-07-291-1/+1
| | | | | Should be unneeded with Python 2.7 and up. Added some unicode_literals along the way.
* Fixed #15363 -- Renamed and normalized to `get_queryset` the methods that ↵Loic Bistuer2013-03-081-6/+6
| | | | return a QuerySet.
* Merged regressiontests and modeltests into the test root.Florian Apolloner2013-02-263-0/+316