diff options
author | Hasan Ramezani <hasan.r67@gmail.com> | 2020-10-18 18:29:52 +0200 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-11-06 09:24:50 +0100 |
commit | 3f7b3275627385f8f7531fca01cdda50d4ec6b6e (patch) | |
tree | fb082d40e73f6c877911eab92229ac21cdfaa5bc /tests/fixtures_regress | |
parent | 13b6fff11703a694e155b84d41d02822bbc0aaa0 (diff) | |
download | django-3f7b3275627385f8f7531fca01cdda50d4ec6b6e.tar.gz |
Fixed #31235 -- Made assertQuerysetEqual() compare querysets directly.
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>
Diffstat (limited to 'tests/fixtures_regress')
-rw-r--r-- | tests/fixtures_regress/tests.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/fixtures_regress/tests.py b/tests/fixtures_regress/tests.py index cc4cee3de4..4a22dc0246 100644 --- a/tests/fixtures_regress/tests.py +++ b/tests/fixtures_regress/tests.py @@ -747,7 +747,8 @@ class NaturalKeyFixtureTests(TestCase): "<Book: Cryptonomicon by Neal Stephenson (available at Amazon, Borders)>", "<Book: Ender's Game by Orson Scott Card (available at Collins Bookstore)>", "<Book: Permutation City by Greg Egan (available at Angus and Robertson)>", - ] + ], + transform=repr, ) @@ -845,10 +846,7 @@ class M2MNaturalKeyFixtureTests(TestCase): obj.save() new_a = M2MSimpleA.objects.get_by_natural_key("a") - self.assertQuerysetEqual(new_a.b_set.all(), [ - "<M2MSimpleB: b1>", - "<M2MSimpleB: b2>" - ], ordered=False) + self.assertCountEqual(new_a.b_set.all(), [b1, b2]) class TestTicket11101(TransactionTestCase): |