summaryrefslogtreecommitdiff
path: root/tests/model_fields
diff options
context:
space:
mode:
authorHasan Ramezani <hasan.r67@gmail.com>2020-10-18 18:29:52 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-11-06 09:24:50 +0100
commit3f7b3275627385f8f7531fca01cdda50d4ec6b6e (patch)
treefb082d40e73f6c877911eab92229ac21cdfaa5bc /tests/model_fields
parent13b6fff11703a694e155b84d41d02822bbc0aaa0 (diff)
downloaddjango-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/model_fields')
-rw-r--r--tests/model_fields/test_datetimefield.py7
1 files changed, 3 insertions, 4 deletions
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):