summaryrefslogtreecommitdiff
path: root/tests/foreign_object/tests.py
AgeCommit message (Collapse)Author
2025-10-16Refs #28586 -- Copied fetch modes to related objects.Adam Johnson
This change ensures that behavior and performance remain consistent when traversing relationships.
2025-09-16Fixed #36580 -- Fixed constraint validation crash when condition uses a ↵SaJH
ForeignObject. Follow-up to e44e8327d3d88d86895735c0e427102063ff5b55. Refs #36222.
2025-09-16Refs #36580 -- Added coverage for excluding ForeignObject from constraint ↵SaJH
validation.
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-09Fixed #36207 -- Cleared cached ForeignObject relations via refresh_from_db().Jacob Walls
2025-04-16Americanized some spellings.Adam Johnson
2025-04-03Fixed #36290 -- Made TupleIn() lookup discard tuples containing None.Simon Charette
Just like the In() lookup discards of None members TupleIn() should discard tuples containing any None as NULL != NULL in SQL and the framework expects such queries to be elided under some circumstances. Refs #31667, #36116. Thanks Basptise Mispelon for bisecting the regression to 626d77e.
2025-02-18Refs #36005 -- Used datetime.UTC alias instead of datetime.timezone.utc.Mariusz Felisiak
datetime.UTC was added in Python 3.11.
2025-01-21Fixed #36116 -- Optimized multi-column ForwardManyToOne prefetching.Simon Charette
Rely on ColPairs and TupleIn which support a single column to be specified to avoid special casing ForwardManyToOne.get_prefetch_querysets(). Thanks Jacob Walls for the report.
2025-01-15Refs #16055 -- Removed get_joining_columns()/get_reverse_joining_columns() ↵Sarah Boyce
methods per deprecation timeline.
2024-09-20Refs #373 -- Updated TupleIsNull lookup to check if any is NULL rather than all.Bendeguz Csirmaz
Regression in 1eac690d25dd49088256954d4046813daa37dc95.
2024-08-28Refs #16055 -- Adjusted deprecation warning stacklevel in ↵Simon Charette
get_joining_columns()/get_reverse_joining_columns().
2024-07-22Fixed #35614 -- Prevented SQLCompiler.as_subquery_condition() from mutating ↵Bendeguz Csirmaz
a query.
2023-04-18Refs #16055 -- Deprecated ↵David Wobrock
get_joining_columns()/get_reverse_joining_columns() methods.
2023-02-01Refs #33476 -- Applied Black's 2023 stable style.David Smith
Black 23.1.0 is released which, as the first release of the year, introduces the 2023 stable style. This incorporates most of last year's preview style. https://github.com/psf/black/releases/tag/23.1.0
2022-10-08Refs #33990 -- Renamed TransactionTestCase.assertQuerysetEqual() to ↵Gregor Gärtner
assertQuerySetEqual(). Co-Authored-By: Michael Howitz <mh@gocept.com>
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 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2021-11-03Fixed #32996 -- Cached PathInfos on relations.Keryn Knight
PathInfo values are ostensibly static over the lifetime of the object for which they're requested, so the data can be memoized, quickly amortising the cost over the process' duration.
2021-05-12Fixed #32366 -- Updated datetime module usage to recommended approach.Nick Pope
- Replaced datetime.utcnow() with datetime.now(). - Replaced datetime.utcfromtimestamp() with datetime.fromtimestamp(). - Replaced datetime.utctimetuple() with datetime.timetuple(). - Replaced calendar.timegm() and datetime.utctimetuple() with datetime.timestamp().
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-02-19Fixed typos in docs and a test comment.Yoo In Keun
2020-02-04Simplified imports from django.db and django.contrib.gis.db.Nick Pope
2018-11-27Adjusted code style of a few test data setup methods.Simon Charette
Thanks Mariusz for suggesting it.
2018-11-27Switched setUp() to setUpTestData() where possible in Django's tests.Simon Charette
2018-11-08Fixed #29908 -- Fixed setting of foreign key after related set access if ↵Simon Charette
ForeignKey uses to_field. Adjusted known related objects handling of target fields which relies on from and to_fields and has the side effect of fixing a bug bug causing N+1 queries when using reverse foreign objects. Thanks Carsten Fuchs for the report.
2017-07-29Used assertRaisesMessage() to test Django's error messages.Mads Jensen
2017-06-01Sorted imports per isort 4.2.9.Tim Graham
2016-11-10Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings.za
2016-09-13Fixed #27203 -- Replaced assertQuerysetEqual(..., lambda o: o) with ↵Mads Jensen
assertSequenceEqual().
2016-02-11Fixed #26153 -- Reallowed Q-objects in ↵Anssi Kääriäinen
ForeignObject.get_extra_descriptor_filter().
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-24Fixed #25972 -- Restored support for the isnull lookup with ForeignObject.Tomo Otsuka
2015-11-14Refs #25745 -- Isolated a foreign_object test.Simon Charette
2015-11-03Fixed #25668 -- Misc spelling errorsVille Skyttä
2015-10-14Refs #25535 -- Minor edits to ForeignObject check changes.Tim Graham
2015-10-12Fixed #25535 -- Made ForeignObject checks less strict.Antoine Catton
Check that the foreign object `from_fields` are a subset of any unique constraints on the foreign model.
2015-08-14Moved foreign_object models.py into a module.Tim Graham
2015-08-03Added test for ForeignObject.get_extra_descriptor_filter()Alex Hill
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2014-12-02Ensured foreign_object tests reset language properly.Preston Timmons
2014-11-03Fixed #23620 -- Used more specific assertions in the Django test suite.Berker Peksag
2013-12-06Fixed #21566 -- Fixed AttributeError when using bulk_create with ForeignObject.Roger Hu
2013-11-02PEP8 cleanupJason Myers
Signed-off-by: Jason Myers <jason@jasonamyers.com>
2013-08-13Fixed #20874 -- bump_prefix() in nested subqueriesAnssi Kääriäinen
Also made some cleanup to build_filter() code by introducing submethods solve_lookup_type() and prepare_lookup_value().
2013-08-06Fixed ordering related test failureAnssi Kääriäinen
Also PEP8 + python_2_unicode_compatible cleanup done.
2013-07-25Fixed ._meta.pk_index() virtual field failureAnssi Kääriäinen
2013-06-27Add related_query_name to ForeignKey/M2M. Refs #20244Andrew Godwin