summaryrefslogtreecommitdiff
path: root/tests/many_to_many
Commit message (Collapse)AuthorAgeFilesLines
* Fixed #33984 -- Reverted "Fixed #32980 -- Made models cache related managers."Mariusz Felisiak2022-09-301-0/+19
| | | | | | | | This reverts 4f8c7fd9d91b35e2c2922de4bb50c8c8066cbbc6 and adds two regression tests: - test_related_manager_refresh(), and - test_create_copy_with_m2m(). Thanks joeli for the report.
* Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak2022-02-071-1/+4
|
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-072-66/+100
|
* Fixed 32956 -- Lowercased spelling of "web" and "web framework" where ↵David Smith2021-07-291-7/+7
| | | | appropriate.
* Fixed #31235 -- Made assertQuerysetEqual() compare querysets directly.Hasan Ramezani2020-11-061-286/+145
| | | | | | | | 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>
* Refs #31395 -- Relied on setUpTestData() test data isolation in various tests.Simon Charette2020-05-151-13/+14
|
* Fixed #31095 -- Made RelatedManager.set() preserve existing m2m relations ↵Hasan Ramezani2019-12-191-0/+13
| | | | with an invalid type.
* Fixed #8467 -- Prevented crash when adding existent m2m relation with an ↵Simon Charette2019-11-221-1/+9
| | | | | | | | | | | | | | | | | | invalid type. This was an issue anymore on backends that allows conflicts to be ignored (Refs #19544) as long the provided values were coercible to the expected type. However on the remaining backends that don't support this feature, namely Oracle, this could still result in an IntegrityError. By attempting to coerce the provided values to the expected types in Python beforehand we allow the existing value set intersection in ManyRelatedManager._get_missing_target_ids to prevent the problematic insertion attempts. Thanks Baptiste Mispelon for triaging this old ticket against the current state of the master branch.
* Refs #8467 -- Added test for RelatedManager.add()/remove() with an invalid type.Simon Charette2019-11-221-0/+6
|
* Refs #26678 -- Added tests for using the field the relation points to with ↵Tobias Kunze2019-05-072-1/+42
| | | | RelatedManager.add()/remove()/set().
* Refs #30325 -- Added tests for using count()/exists() with custom managers ↵Tobias Kunze2019-04-152-0/+13
| | | | and reverse M2M relations.
* Fixed #30325 -- Reverted "Fixed #29725 -- Removed unnecessary join in ↵Mariusz Felisiak2019-04-152-50/+2
| | | | | | | QuerySet.count() and exists() on a many-to-many relation." This reverts commit 1299421cadc4fcf63585f2f88337078e43e660e0 due to a regression with custom managers.
* Cleaned up exception message checking in some tests.Jon Dufresne2019-03-151-1/+2
|
* Refs #19544 -- Added a fast path for through additions if supported.Simon Charette2019-02-211-2/+15
| | | | | The single query insertion path is taken if the backend supports inserts that ignore conflicts and m2m_changed signals don't have to be sent.
* Refs #19544 -- Ignored auto-created through additions conflicts if supported.Simon Charette2019-02-211-0/+10
| | | | | This prevents IntegrityError caused by race conditions between missing ids retrieval and bulk insertions.
* Followed style guide for model attribute ordering.Matt Wiens2018-12-271-6/+6
|
* Fixed #29725 -- Removed unnecessary join in QuerySet.count() and exists() on ↵oliver2018-10-152-3/+53
| | | | a many-to-many relation.
* Fixed typo in tests/many_to_many/tests.py.Rajesh Veeranki2017-10-311-2/+2
|
* Used assertRaisesMessage() to test Django's error messages.Mads Jensen2017-07-291-1/+5
|
* Refs #23919, #27778 -- Removed obsolete mentions of unicode.Vytis Banaitis2017-01-261-1/+1
|
* Refs #23919 -- Removed python_2_unicode_compatible decorator usageClaude Paroz2017-01-181-4/+0
|
* Refs #23919 -- Removed encoding preambles and future importsClaude Paroz2017-01-182-4/+0
|
* Refs #25550 -- Removed support for direct assignment to the reverse side of ↵Tim Graham2017-01-171-31/+7
| | | | a related set.
* Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings.za2016-11-101-6/+6
|
* Refs #25415 -- Fixed invalid models in the test suite.Adam Chainz2016-09-091-1/+0
|
* Fixed #26706 -- Made RelatedManager modification methods clear ↵Yoong Kang Lim2016-08-051-0/+34
| | | | prefetch_related() cache.
* Refs #25550 -- Corrected deprecation message for assigning M2M relations.Tim Graham2016-07-301-2/+11
|
* Fixed #26176 -- Fixed E123 flake8 warnings.26176Tim Graham2016-02-051-121/+144
|
* Refs #26022 -- Used context manager version of assertRaises in tests.Hasan2016-01-291-1/+2
|
* Fixed #14286 -- Added models.BigAutoField.Alexander Sosnovskiy2015-12-251-0/+10
|
* Fixed #25550 -- Deprecated direct assignment to the reverse side of a ↵Tim Graham2015-10-271-11/+41
| | | | related set.
* Renamed descriptor classes for related objects.Aymeric Augustin2015-09-211-2/+2
| | | | | | | | | | | | 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 #24156 -- Fixed inherited related name of ManyToManyField.Andriy Sokolovskiy2015-05-122-1/+43
| | | | | Fixed situation when parent abstract model declares related_name='+', and child models had an invalid queryset.
* Merged ManyRelatedObjectsDescriptor and ReverseManyRelatedObjectsDescriptorLoic Bistuer2015-02-161-1/+1
| | | | | and made all "many" related objects descriptors inherit from ForeignRelatedObjectsDescriptor.
* Fixed #6707 -- Added RelatedManager.set() and made descriptors' __set__ use it.Loic Bistuer2015-02-051-0/+39
| | | | Thanks Anssi Kääriäinen, Carl Meyer, Collin Anderson, and Tim Graham for the reviews.
* 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 mistake in tests from commit 2039908. Refs #19816.Loic Bistuer2014-03-301-2/+2
|
* Fixed #19816 -- Pre-evaluate querysets used in direct relation assignments.Loic Bistuer2014-03-301-0/+24
| | | | | | | | | | 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.
* Fixed transaction handling for a number of operations on related objects.Loic Bistuer2014-03-301-1/+4
| | | | Thanks Anssi and Aymeric for the reviews. Refs #21174.
* PEP8 cleanupJason Myers2013-11-021-0/+1
| | | | Signed-off-by: Jason Myers <jason@jasonamyers.com>
* Fix all violators of E231Alex Gaynor2013-10-261-6/+6
|
* Removed unused local variables in tests.Tim Graham2013-10-191-2/+2
|
* Removed most of absolute_import importsClaude Paroz2013-07-291-1/+1
| | | | | Should be unneeded with Python 2.7 and up. Added some unicode_literals along the way.
* Fixed #20207 -- Handle ManyToManyField with a unicode name correctly.Simon Charette2013-04-051-1/+4
|
* Merged regressiontests and modeltests into the test root.Florian Apolloner2013-02-263-0/+423