From 3f7b3275627385f8f7531fca01cdda50d4ec6b6e Mon Sep 17 00:00:00 2001 From: Hasan Ramezani Date: Sun, 18 Oct 2020 18:29:52 +0200 Subject: Fixed #31235 -- Made assertQuerysetEqual() compare querysets directly. This also replaces assertQuerysetEqual() to assertSequenceEqual()/assertCountEqual() where appropriate. Co-authored-by: Peter Inglesby Co-authored-by: Mariusz Felisiak --- tests/model_fields/test_datetimefield.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'tests/model_fields') diff --git a/tests/model_fields/test_datetimefield.py b/tests/model_fields/test_datetimefield.py index ea759e08c6..1c37760711 100644 --- a/tests/model_fields/test_datetimefield.py +++ b/tests/model_fields/test_datetimefield.py @@ -59,14 +59,13 @@ class DateTimeFieldTests(TestCase): m1 = DateTimeModel.objects.create(d=d, dt=dt1, t=t) m2 = DateTimeModel.objects.create(d=d, dt=dt2, t=t) # In Vancouver, we expect both results. - self.assertQuerysetEqual( + self.assertCountEqual( DateTimeModel.objects.filter(dt__date=d), - [repr(m1), repr(m2)], - ordered=False + [m1, m2], ) with self.settings(TIME_ZONE='UTC'): # But in UTC, the __date only matches one of them. - self.assertQuerysetEqual(DateTimeModel.objects.filter(dt__date=d), [repr(m1)]) + self.assertCountEqual(DateTimeModel.objects.filter(dt__date=d), [m1]) class ValidationTest(SimpleTestCase): -- cgit v1.3