summaryrefslogtreecommitdiff
path: root/tests/generic_relations
Commit message (Collapse)AuthorAgeFilesLines
* Fixed #34280 -- Allowed specifying different field values for create ↵tschilling2023-02-141-0/+60
| | | | operation in QuerySet.update_or_create().
* Fixed #34135 -- Added async-compatible interface to related managers.Jon Janzen2022-11-091-0/+27
|
* Fixed #34139 -- Fixed acreate(), aget_or_create(), and aupdate_or_create() ↵Jon Janzen2022-11-081-0/+28
| | | | | | methods for related managers. Bug in 58b27e0dbb3d31ca1438790870b2b51ecdb10500.
* Refs #33990 -- Renamed TransactionTestCase.assertQuerysetEqual() to ↵Gregor Gärtner2022-10-081-5/+5
| | | | | | assertQuerySetEqual(). Co-Authored-By: Michael Howitz <mh@gocept.com>
* Fixed #33004 -- Made saving objects with unsaved GenericForeignKey raise ↵sarahboyce2022-04-211-9/+20
| | | | | | | | ValueError. This aligns to the behaviour of OneToOneField and ForeignKey fields. Thanks Jonny Park for the initial patch.
* Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak2022-02-072-40/+91
|
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-073-197/+269
|
* Refs #32045 -- Added tests for GenericRelatedObjectManager.clear()/remove().Craig Smith2020-11-061-0/+24
|
* Fixed #31235 -- Made assertQuerysetEqual() compare querysets directly.Hasan Ramezani2020-11-061-77/+47
| | | | | | | | 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>
* Fixed #32042 -- Improved error messages for the number of submitted forms in ↵meghanabhange2020-09-281-2/+2
| | | | formsets.
* Refs #9061 -- Allowed GenericInlineFormSet to disable deleting extra forms.Mariusz Felisiak2020-08-181-0/+24
| | | | Follow up to 162765d6c3182e36095d29543e21b44b908625fc.
* Refs #20347 -- Allowed customizing the maximum number of instantiated forms ↵Mariusz Felisiak2020-08-181-0/+34
| | | | | | in generic_inlineformset_factory(). Follow up to 433dd737f94b09043f64b873b0ac067b3f97364b.
* Refs #31395 -- Relied on setUpTestData() test data isolation in various tests.Simon Charette2020-05-151-14/+15
|
* Fixed #31190 -- Fixed prefetch_related() crash for GenericForeignKey with ↵Eugene Hatsko2020-01-221-0/+13
| | | | | | custom ContentType foreign key. Regression in dffa3e1992562ba60512d96d1eb5859ffff2ceb5.
* Fixed #30493 -- Fixed prefetch_related() for GenericRelation with different ↵can2019-05-311-0/+18
| | | | | | | | content types. Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com> Thanks Simon Charette for the review.
* Fixed #29612 -- Added GenericRelation prefetch_related() cache invalidation.Tom Forbes2018-08-171-0/+47
|
* Fixed #29038 -- Removed closing slash from HTML void tags.Jon Dufresne2018-01-211-16/+16
|
* Fixed #14642 -- Fixed generic inline formsets crash when using save_as_new=True.Tomer Chachamu2017-12-301-0/+37
|
* Moved generic_inlineformset_factory() tests to a separate file.Tim Graham2017-12-282-179/+203
|
* Used assertRaisesMessage() to test Django's error messages.Mads Jensen2017-07-291-1/+6
|
* Refs #27745 -- Improved test coverage of contrib.contenttypes.Anton Samarchyan2017-02-031-1/+16
|
* Refs #23919 -- Replaced super(ClassName, self) with super().chillaranand2017-01-252-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-182-4/+0
|
* Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings.za2016-11-101-6/+5
|
* Refs #18599 -- Added a test for assigning a GenericForeignKey in ↵Bouke Haarsma2016-05-131-0/+5
| | | | | | | Model.__init__(). The issue was fixed by 8a47ba679d2da0dee74671a53ba0cd918b433e34 (refs #16508).
* Refs #16508 -- Added invalidation of stale cached instances of ↵Michal Petrucha2016-05-031-0/+17
| | | | GenericForeignKey targets.
* Fixed E128 flake8 warnings in tests/.Tim Graham2016-04-081-12/+6
|
* Fixed #26179 -- Removed null assignment check for non-nullable foreign key ↵ZachLiuGIS2016-02-111-6/+3
| | | | fields.
* Refs #26022 -- Replaced six.assertRaisesRegex with assertRaisesMessage as ↵Hasan2016-01-291-3/+2
| | | | appropriate.
* Fixed #12885 -- Fixed queries with GenericRelations to multi-table ↵Anssi Kääriäinen2015-12-141-0/+7
| | | | inheritance child models.
* Fixed #25550 -- Deprecated direct assignment to the reverse side of a ↵Tim Graham2015-10-271-6/+6
| | | | related set.
* Refs #19722 -- Added a test for querying generic relations of a parent class.Tim Graham2015-10-082-2/+15
| | | | Fixed in c9a96075fa02b6d52bec748ffdfb413688a15774.
* Refs #13203, #9501 -- Added a test for generic relations to child models.Tim Graham2015-10-022-1/+13
| | | | Fixed in 97774429aeb54df4c09895c07cd1b09e70201f7d.
* Renamed descriptor classes for related objects.Aymeric Augustin2015-09-211-1/+1
| | | | | | | | | | | | The old names were downright confusing. Some seemed to mean the opposite of what the class actually did. The new names follow a consistent nomenclature: (Forward|Reverse)(ManyToOne|OneToOne|ManyToMany)Descriptor. I mentioned combinations that do not exist in the docstring in order to help people who would search for them in the code base.
* Fixed #23395 -- Limited line lengths to 119 characters.Dražen Odobašić2015-09-121-9/+48
|
* Fixed #25160 -- Moved unsaved model instance data loss check to Model.save()Tim Graham2015-08-101-0/+10
| | | | | | | This mostly reverts 5643a3b51be338196d0b292d5626ad43648448d3 and 81e1a35c364e5353d2bf99368ad30a4184fbb653. Thanks Carl Meyer for review.
* Fixed #18556 -- Allowed RelatedManager.add() to execute 1 query where possible.Tim Graham2015-07-281-2/+28
| | | | Thanks Loic Bistuer for review.
* Fixed #21127 -- Started deprecation toward requiring on_delete for ↵Flavio Curella2015-07-271-6/+6
| | | | ForeignKey/OneToOneField
* Refs #24652 -- Used SimpleTestCase where appropriate.Simon Charette2015-05-201-2/+2
|
* Sorted imports with isort; refs #23860.Tim Graham2015-02-062-5/+6
|
* Fixed #6707 -- Added RelatedManager.set() and made descriptors' __set__ use it.Loic Bistuer2015-02-051-0/+52
| | | | Thanks Anssi Kääriäinen, Carl Meyer, Collin Anderson, and Tim Graham for the reviews.
* Fixed #24099 -- Removed contenttype.name deprecated fieldClaude Paroz2015-01-161-1/+1
| | | | | | This finsishes the work started on #16803. Thanks Simon Charette, Tim Graham and Collin Anderson for the reviews.
* Fixed #12663 -- Formalized the Model._meta API for retrieving fields.Daniel Pyrathon2015-01-061-1/+2
| | | | | Thanks to Russell Keith-Magee for mentoring this Google Summer of Code 2014 project and everyone else who helped with the patch!
* Fixed flake8 warning.Tim Graham2014-10-081-1/+0
|
* Fixed #23611 -- update_or_create failing from a related managerLoic Bistuer2014-10-081-0/+48
| | | | | | Added update_or_create to RelatedManager, ManyRelatedManager and GenericRelatedObjectManager. Added missing get_or_create to GenericRelatedObjectManager.
* Removed numbering from the models.py header of some test packages.Loic Bistuer2014-09-241-1/+1
| | | | This is a reliqua from the early days of the modeltests/regressiontests era.
* Fixed #22992 -- regression in .filter(generic_fk=...) error messageAnssi Kääriäinen2014-07-141-0/+4
| | | | | | | | | | | | | | Generic Foreign Keys can't be used as lhs in lookups for historical reasons. Django 1.6 gave a FieldDoesNotExist exception when using GFKs as lhs in lookups, but due to regression caused by lookup refactor patch (20bab2cf9d02a5c6477d8aac066a635986e0d3f3) the exception type was changed to AttributeError. It might be a good idea to add support for gfk__exact and gfk__in lookups later on. Thanks to glicerinu@gmail.com for the report. The code in this commit was written by Tim Graham.
* Split GenericRelationsTests.test_generic_relations into several tests; refs ↵José L. Patiño2014-06-011-98/+134
| | | | #18586.
* Fixed #19816 -- Pre-evaluate querysets used in direct relation assignments.Loic Bistuer2014-03-301-0/+15
| | | | | | | | | | Since assignments on M2M or reverse FK descriptors is composed of a `clear()`, followed by an `add()`, `clear()` could potentially affect the value of the assigned queryset before the `add()` step; pre-evaluating it solves the problem. This patch fixes the issue for ForeignRelatedObjectsDescriptor, ManyRelatedObjectsDescriptor, and ReverseGenericRelatedObjectsDescriptor. It completes 6cb6e1 which addressed ReverseManyRelatedObjectsDescriptor.