summaryrefslogtreecommitdiff
path: root/tests/managers_regress
AgeCommit message (Collapse)Author
2022-02-07Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2021-02-10Fixed #32355 -- Dropped support for Python 3.6 and 3.7Mariusz Felisiak
2020-11-06Fixed #31235 -- Made assertQuerysetEqual() compare querysets directly.Hasan Ramezani
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>
2020-04-15Fixed #31223 -- Added __class_getitem__() to Manager and QuerySet.sobolevn
2018-11-27Switched TestCase to SimpleTestCase where possible in Django's tests.Tim Graham
2018-03-20Fixed #29227 -- Allowed BooleanField to be null=True.Tim Graham
Thanks Lynn Cyrin for contributing to the patch, and Nick Pope for review.
2017-11-06Fixed #28776 -- Fixed a/an/and typos in docs and comments.Дилян Палаузов
2017-01-25Refs #23919 -- Replaced super(ClassName, self) with super().chillaranand
2017-01-24Removed unneeded force_text calls in the test suiteClaude Paroz
2017-01-18Refs #23919 -- Removed python_2_unicode_compatible decorator usageClaude Paroz
2017-01-18Refs #23919 -- Removed encoding preambles and future importsClaude Paroz
2017-01-17Removed Manager.use_for_related_fields and Meta.manager_inheritance_from_future.Tim Graham
Per deprecation timeline. Refs ed0ff913c648b16c4471fc9a9441d1ee48cb5420.
2017-01-17Removed GeoManager and GeoQuerySet per deprecation timeline.Tim Graham
2016-08-19Fixed #27073 -- Removed duplicated managers in `Model._meta.managers`.Loïc Bistuer
2016-07-11Fixed #26749 -- Preserved behavior of use_for_related_field during deprecation.Julien Hartmann
2016-05-17Fixed #10506, #13793, #14891, #25201 -- Introduced new APIs to specify ↵Loïc Bistuer
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.
2016-05-17Fixed #20932, #25897 -- Streamlined manager inheritance.Loïc Bistuer
2016-05-13Cosmetic edits to tests/managers_regress/tests.pyTim Graham
2016-01-06Fixed #25746 -- Isolated inlined test models registration.Simon Charette
Thanks to Tim for the review.
2015-07-27Fixed #21127 -- Started deprecation toward requiring on_delete for ↵Flavio Curella
ForeignKey/OneToOneField
2015-07-02Used assertRaisesMessage in managers_regress tests.Tim Graham
2015-07-02Fixed #25054 -- Added app_label to swapped model AttributeErrorChris Lamb
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2015-01-29Fixed #23940 -- Allowed model fields to be named `exact`.Simon Charette
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.
2014-01-26Fixed #19774 -- Deprecated the contenttypes.generic module.Simon Charette
It contained models, forms and admin objects causing undesirable import side effects. Refs #16368. Thanks to Ramiro, Carl and Loïc for the review.
2013-12-29Used Apps.clear_cache() in tests that alter the app registry.Aymeric Augustin
2013-12-24Renamed AppCache to Apps.Aymeric Augustin
Also renamed app_cache to apps and "app cache" to "app registry". Deprecated AppCache.app_cache_ready() in favor of Apps.ready().
2013-12-24Replaced ad-hoc caching of get_models with lru_cache.Aymeric Augustin
Invalidate properly the cache whenever all_models or app_configs change. This fixes some isolation issues in the test suite.
2013-12-23Imported override_settings from its new location.Aymeric Augustin
2013-12-22Moved apps back in the toplevel django namespace.Aymeric Augustin
Reverted 4a56a93cc458e9ab4dcab95d9f5067d4975dd1a2.
2013-12-22Refactored registration of models.Aymeric Augustin
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.
2013-12-17Moved the new app cache inside core.Aymeric Augustin
2013-12-17Moved list of models inside AppConfig instances.Aymeric Augustin
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.
2013-12-17Removed module-level functions for the app cache.Aymeric Augustin
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.
2013-12-17Removed BaseAppCache.app_store.Aymeric Augustin
It was only storing redundant information. This is part of the effort to allow applications without a models module.
2013-12-17Moved django.db.models.loading to django.apps.cache.Aymeric Augustin
This commit doesn't contain any code changes; it's purely a refactoring.
2013-11-02Fixed #21302 -- Fixed unused imports and import *.Tim Graham
2013-10-21Removed some direct settings manipulations in tests; refs #21230.Bouke Haarsma
2013-10-21Fixed #21288 -- Fixed E126 pep8 warningsAlasdair Nicol
2013-10-18Fixed #21287 -- Fixed E123 pep8 warningsAlasdair Nicol
2013-09-30Fixed #3871 -- Fixed regression introduced by 04a2a6b.Loic Bistuer
Added do_not_call_in_templates=True attribute to RelatedManagers to prevent them from being called. Thanks jbg@ for the report.
2013-07-29Removed most of absolute_import importsClaude Paroz
Should be unneeded with Python 2.7 and up. Added some unicode_literals along the way.
2013-03-08Fixed #15363 -- Renamed and normalized to `get_queryset` the methods that ↵Loic Bistuer
return a QuerySet.
2013-02-26Merged regressiontests and modeltests into the test root.Florian Apolloner