summaryrefslogtreecommitdiff
path: root/tests/proxy_models/tests.py
AgeCommit message (Collapse)Author
2017-11-21Fixed #28820 -- Eliminated an extra query with QuerySet.update() on proxy ↵Yan Mitrofanov
models.
2017-01-18Refs #23919 -- Removed encoding preambles and future importsClaude Paroz
2016-09-13Fixed #27203 -- Replaced assertQuerysetEqual(..., lambda o: o) with ↵Mads Jensen
assertSequenceEqual().
2016-06-28Replaced use of TestCase.fail() with assertRaises().Tim Graham
Also removed try/except/fail antipattern that hides exceptions.
2016-06-03Fixed #15250 -- Avoided extra query on some multi-table inheritance queries.Paulo
Thanks marekw2143 for the initial patch and carljm for support.
2016-04-08Fixed E128 flake8 warnings in tests/.Tim Graham
2016-03-30Fixed #11560 -- Allowed proxy model multiple-inheritance from the same ↵Akshesh
concrete base model.
2016-03-30Made a few proxy_models tests use assertRaisesMessage().Tim Graham
2016-02-12Removed unneeded hint=None/obj=None in system check messages.Tim Graham
2016-02-06Fixed #26175 -- Removed SHA1 password hashes in tests.Tim Graham
2016-01-29Refs #26022 -- Used context manager version of assertRaises in tests.Hasan
2016-01-06Fixed #25746 -- Isolated inlined test models registration.Simon Charette
Thanks to Tim for the review.
2015-12-31Fixed #26013 -- Moved django.core.urlresolvers to django.urls.Marten Kenbeek
Thanks to Tim Graham for the review.
2015-12-03Fixed many spelling mistakes in code, comments, and docs.Josh Soref
2015-10-12Fixed #18012 -- Propagated reverse foreign keys from proxy to concrete models.Simon Charette
Thanks to Anssi for the review.
2015-04-15Updated tests to stop leaking models in shared AdminSite.Riccardo Magliocchetti
This would break upcoming changes and AdminSite assumptions about having an app_config for each application that has registered models.
2015-03-05Converted test fixtures to setUpTestData methodsJosh Smeaton
2015-02-20Fixed #24328 -- cleaned up Options._get_fields() implementationAnssi Kääriäinen
2015-02-09Replaced some more hardcoded admin URLsClaude Paroz
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2015-02-03Fixed #24149 -- Normalized tuple settings to lists.darkryder
2014-11-03Fixed #23620 -- Used more specific assertions in the Django test suite.Berker Peksag
2014-06-02Fixed #22690 -- Added a check for proxy models containing fields.Craig de Stigter
Removed the FieldError raised by ModelBase.__new__ in this case.
2014-04-06Fixed #21977 -- Deprecated SimpleTestCase.urlsAnubhav Joshi
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-12-10Fixed E124 pep8 warnings.Loic Bistuer
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-19Removed unused local variables in tests.Tim Graham
2013-09-16Fixed #17627 -- Renamed util.py files to utils.pyTim Graham
Thanks PaulM for the suggestion and Luke Granger-Brown and Wiktor Kołodziej for the initial patch.
2013-08-30Fixed #20989 -- Removed useless explicit list comprehensions.Simon Charette
2013-08-19Fixed #20777 -- Admin proxy model deletion regressionAnssi Kääriäinen
Added proxy_models tests by Harm Geerts <github@geertswei.nl>.
2013-08-19Made Model.__eq__ consider proxy models equivalentAnssi Kääriäinen
Fixed #11892, fixed #16458, fixed #14492.
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-06-30Stopped calling loaddata with commit=False.Aymeric Augustin
This was a stealth option only used by the tests, and it isn't useful any more since `atomic` provides nested transactions.
2013-02-26Merged regressiontests and modeltests into the test root.Florian Apolloner