mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
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>
This commit is contained in:
parent
13b6fff117
commit
3f7b327562
39 changed files with 1447 additions and 1801 deletions
|
@ -100,12 +100,12 @@ class SelectRelatedRegressTests(TestCase):
|
|||
def test_multi_table_inheritance(self):
|
||||
""" Exercising select_related() with multi-table model inheritance. """
|
||||
c1 = Child.objects.create(name="child1", value=42)
|
||||
Item.objects.create(name="item1", child=c1)
|
||||
Item.objects.create(name="item2")
|
||||
i1 = Item.objects.create(name="item1", child=c1)
|
||||
i2 = Item.objects.create(name="item2")
|
||||
|
||||
self.assertQuerysetEqual(
|
||||
self.assertSequenceEqual(
|
||||
Item.objects.select_related("child").order_by("name"),
|
||||
["<Item: item1>", "<Item: item2>"]
|
||||
[i1, i2],
|
||||
)
|
||||
|
||||
def test_regression_12851(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue