summaryrefslogtreecommitdiff
path: root/tests/defer_regress
AgeCommit message (Collapse)Author
2025-07-23Refs #36500 -- Rewrapped long docstrings and block comments via a script.django-bot
Rewrapped long docstrings and block comments to 79 characters + newline using script from https://github.com/medmunds/autofix-w505.
2025-05-16Fixed #33312 -- Raised explicit exception when copying deferred model instances.Simon Charette
Previously save() would crash with an attempted forced update message, and both save(force_insert=True) and bulk_create() would crash with DoesNotExist errors trying to retrieve rows with an empty primary key (id IS NULL). Implementing deferred field model instance copying might be doable in certain cases (e.g. when all the deferred fields are db generated) but that's not trivial to implement in a backward compatible way. Thanks Adam Sołtysik for the report and test and Clifford for the review.
2024-04-23Fixed #35356 -- Deferred self-referential foreign key fields adequately.Simon Charette
While refs #34612 surfaced issues with reverse one-to-one fields deferrals, it missed that switching to storing remote fields would break self-referential relationships. This change switches to storing related objects in the select mask instead of remote fields to prevent collisions when dealing with self-referential relationships that might have a different directional mask. Despite fixing #21204 introduced a crash under some self-referential deferral conditions, it was simply not working even before that as it aggregated the sets of deferred fields by model. Thanks Joshua van Besouw for the report and Mariusz Felisiak for the review.
2023-12-31Used addCleanup() in tests where appropriate.Mariusz Felisiak
2023-06-01Fixed #34612 -- Fixed QuerySet.only() crash on reverse relationships.Simon Charette
Regression in b3db6c8dcb5145f7d45eff517bcd96460475c879. Thanks Ian Cubitt for the report. This also corrected test_inheritance_deferred2() test which was previously properly defined and marked as an expected failure but was then wrongly adjusted to mask the lack of support for per-alias deferral that was fixed by #21204.
2023-06-01Refs #34570 -- Added extra tests for QuerySet.only() noops.Simon Charette
2023-05-17Fixed #34570 -- Silenced noop deferral of many-to-many and GFK.Simon Charette
While deferring many-to-many and GFK has no effect, the previous implementation of QuerySet.defer() ignore them instead of crashing. Regression in b3db6c8dcb5145f7d45eff517bcd96460475c879. Thanks Paco Martínez for the report.
2023-01-17Refs #29708 -- Removed PickleSerializer per deprecation timeline.Mariusz Felisiak
2022-10-08Refs #33990 -- Renamed TransactionTestCase.assertQuerysetEqual() to ↵Gregor Gärtner
assertQuerySetEqual(). Co-Authored-By: Michael Howitz <mh@gocept.com>
2022-08-30Fixed #21204 -- Tracked field deferrals by field instead of models.Simon Charette
This ensures field deferral works properly when a model is involved more than once in the same query with a distinct deferral mask.
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
2022-01-13Fixed #29708 -- Deprecated PickleSerializer.Adam Johnson
2020-11-04Removed hardcoded pk in defer_regress test.Tim Graham
2020-04-30Removed unused __str__() methods in tests models.Mariusz Felisiak
Follow up to 6461583b6cc257d25880ef9a9fd7e2125ac53ce1.
2017-05-10Decreased max_length for char fields unless absolutely needed. (#8485)Florian Apolloner
2017-01-18Refs #23919 -- Removed python_2_unicode_compatible decorator usageClaude Paroz
2017-01-18Refs #23919 -- Removed encoding preambles and future importsClaude Paroz
2016-05-10Refs #18100 -- Added tests for deferred model deletion signals.Simon Charette
Thanks Tim for the review and pointing out this was fixed by #26207.
2016-04-29Fixed #26207 -- Replaced dynamic classes with non-data descriptors for ↵Anssi Kääriäinen
deferred instance loading.
2016-04-08Fixed E128 flake8 warnings in tests/.Tim Graham
2016-02-26Fixed #21608 -- Prevented logged out sessions being resurrected by ↵Tore Lundqvist
concurrent requests. Thanks Simon Charette for the review.
2016-01-06Fixed #25746 -- Isolated inlined test models registration.Simon Charette
Thanks to Tim for the review.
2015-10-19Fixed #25563 -- Cached deferred models in their proxied model's _meta.apps.Simon Charette
Thanks to Andriy Sokolovskiy for the report and Tim Graham for the review.
2015-07-27Fixed #21127 -- Started deprecation toward requiring on_delete for ↵Flavio Curella
ForeignKey/OneToOneField
2015-04-27Used assertIsInstance in tests.Alasdair Nicol
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2015-02-04Fixed typos of "select_related" in docs and tests.Josh Schneier
2015-01-08Fixed #24020 -- Refactored SQL compiler to use expressionsAnssi Kääriäinen
Refactored compiler SELECT, GROUP BY and ORDER BY generation. While there, also refactored select_related() implementation (get_cached_row() and get_klass_info() are now gone!). Made get_db_converters() method work on expressions instead of internal_type. This allows the backend converters to target specific expressions if need be. Added query.context, this can be used to set per-query state. Also changed the signature of database converters. They now accept context as an argument.
2014-08-12Avoided creation of deferred model from another deferred modelAnssi Kääriäinen
Also never create deferred model when no attrs are deferred.
2014-06-25Removed unused variable.Tim Graham
2014-06-25Fixed #22050 -- Fixed defer fields on proxy related models.Lovas Bence
2014-01-05Removed useless model definitions.Aymeric Augustin
Surprisingly, this commit doesn't change any behavior at all. When a model is defined with the same name as another model in the same app, the definition of the first class is bound to the name of the class regardless of the definition of the second class.
2013-12-29Deprecated the app argument of apps.get_models.Aymeric Augustin
Use app_config.get_models() instead.
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-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-17Moved the new app cache inside core.Aymeric Augustin
2013-12-17Deprecated get_app().Aymeric Augustin
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-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-02PEP8 cleanupJason Myers
Signed-off-by: Jason Myers <jason@jasonamyers.com>
2013-11-02PEP8Jason Myers
Signed-off-by: Jason Myers <jason@jasonamyers.com>
2013-08-22Fixed #20922 -- Allowed customizing the serializer used by contrib.sessionsTim Graham
Added settings.SESSION_SERIALIZER which is the import path of a serializer to use for sessions. Thanks apollo13, carljm, shaib, akaariai, charettes, and dstufft for reviews.
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-05-31Fixed #16436 -- Oracle defer_regress test failureAnssi Kääriäinen
Oracle doesn't like grouping by TextField, so use CharFields instead in models.
2013-05-30Fixed #16436 -- defer + annotate + select_related crashTai Lee
Correctly calculate the ``aggregate_start`` offset from loaded fields, if any are deferred, instead of ``self.query.select`` which includes all fields on the model. Also made some PEP 8 fixes.
2013-05-30Made an app-cache test not dependent on all models in defer_regressAnssi Kääriäinen
2013-02-26Merged regressiontests and modeltests into the test root.Florian Apolloner