summaryrefslogtreecommitdiff
path: root/tests/proxy_models
Commit message (Collapse)AuthorAgeFilesLines
* Fixed #33816 -- Fixed QuerySet.only() after select_related() crash on proxy ↵Ipakeev2022-07-041-0/+6
| | | | models.
* Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak2022-02-071-2/+8
|
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-074-108/+168
|
* Updated test URL patterns to use path() and re_path().Tim Graham2018-12-311-2/+2
|
* Fixed #28820 -- Eliminated an extra query with QuerySet.update() on proxy ↵Yan Mitrofanov2017-11-211-0/+7
| | | | models.
* Fixed #28776 -- Fixed a/an/and typos in docs and comments.Дилян Палаузов2017-11-061-1/+1
|
* Sorted imports per isort 4.2.9.Tim Graham2017-06-011-1/+0
|
* Refs #23919 -- Replaced super(ClassName, self) with super().chillaranand2017-01-251-2/+2
|
* Refs #23919 -- Removed python_2_unicode_compatible decorator usageClaude Paroz2017-01-181-6/+0
|
* Refs #23919 -- Removed encoding preambles and future importsClaude Paroz2017-01-181-2/+0
|
* Fixed #27203 -- Replaced assertQuerysetEqual(..., lambda o: o) with ↵Mads Jensen2016-09-131-8/+2
| | | | assertSequenceEqual().
* Replaced use of TestCase.fail() with assertRaises().Tim Graham2016-06-281-4/+1
| | | Also removed try/except/fail antipattern that hides exceptions.
* Fixed #15250 -- Avoided extra query on some multi-table inheritance queries.Paulo2016-06-031-1/+1
| | | | Thanks marekw2143 for the initial patch and carljm for support.
* Fixed #10506, #13793, #14891, #25201 -- Introduced new APIs to specify ↵Loïc Bistuer2016-05-171-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 E128 flake8 warnings in tests/.Tim Graham2016-04-081-10/+8
|
* Fixed #11560 -- Allowed proxy model multiple-inheritance from the same ↵Akshesh2016-03-302-4/+16
| | | | concrete base model.
* Made a few proxy_models tests use assertRaisesMessage().Tim Graham2016-03-301-20/+9
|
* Removed unneeded hint=None/obj=None in system check messages.Tim Graham2016-02-121-2/+0
|
* Fixed #26175 -- Removed SHA1 password hashes in tests.Tim Graham2016-02-061-12/+3
|
* Refs #26022 -- Used context manager version of assertRaises in tests.Hasan2016-01-291-23/+14
|
* Fixed #25746 -- Isolated inlined test models registration.Simon Charette2016-01-061-23/+15
| | | | Thanks to Tim for the review.
* Fixed #26013 -- Moved django.core.urlresolvers to django.urls.Marten Kenbeek2015-12-311-1/+1
| | | | Thanks to Tim Graham for the review.
* Fixed many spelling mistakes in code, comments, and docs.Josh Soref2015-12-031-1/+1
|
* Fixed #18012 -- Propagated reverse foreign keys from proxy to concrete models.Simon Charette2015-10-122-7/+12
| | | | Thanks to Anssi for the review.
* Fixed #21127 -- Started deprecation toward requiring on_delete for ↵Flavio Curella2015-07-271-5/+5
| | | | ForeignKey/OneToOneField
* Fixed #21927 -- Made application and instance namespaces more distinct.Marten Kenbeek2015-06-081-2/+2
| | | | | | Made URL application namespaces be set in the included URLconf and instance namespaces in the call to include(). Deprecated other ways to set application and instance namespaces.
* Updated tests to stop leaking models in shared AdminSite.Riccardo Magliocchetti2015-04-153-8/+10
| | | | | | This would break upcoming changes and AdminSite assumptions about having an app_config for each application that has registered models.
* Converted test fixtures to setUpTestData methodsJosh Smeaton2015-03-052-43/+14
|
* Fixed #24328 -- cleaned up Options._get_fields() implementationAnssi Kääriäinen2015-02-202-3/+13
|
* Replaced some more hardcoded admin URLsClaude Paroz2015-02-091-7/+9
|
* Sorted imports with isort; refs #23860.Tim Graham2015-02-064-10/+10
|
* Fixed #24149 -- Normalized tuple settings to lists.darkryder2015-02-031-1/+1
|
* Fixed #23620 -- Used more specific assertions in the Django test suite.Berker Peksag2014-11-031-4/+4
|
* Fixed #22690 -- Added a check for proxy models containing fields.Craig de Stigter2014-06-021-8/+20
| | | | Removed the FieldError raised by ModelBase.__new__ in this case.
* Fixed #21977 -- Deprecated SimpleTestCase.urlsAnubhav Joshi2014-04-061-2/+2
|
* Fixed #22218 -- Deprecated django.conf.urls.patterns.Tim Graham2014-04-031-4/+4
| | | | Thanks Carl Meyer for the suggestion and Alex Gaynor and Carl for reviews.
* Used Apps.clear_cache() in tests that alter the app registry.Aymeric Augustin2013-12-291-1/+1
|
* Renamed AppCache to Apps.Aymeric Augustin2013-12-241-5/+5
| | | | | | 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-1/+1
| | | | | 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/+1
| | | | | | | | | | | | | | | | | | | | | | | 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-7/+6
| | | | | | | | | | | | | | | | | | | | | | | 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-3/+3
| | | | | | | | | | | | | | | 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-2/+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 E124 pep8 warnings.Loic Bistuer2013-12-101-6/+12
|
* Fixing E302 ErrorsJason Myers2013-11-021-0/+26
| | | | Signed-off-by: Jason Myers <jason@jasonamyers.com>
* Fixed #21302 -- Fixed unused imports and import *.Tim Graham2013-11-021-2/+1
|