Skip to content

Commit

Permalink
Rename assertQuery{s,S}etEqual in tests
Browse files Browse the repository at this point in the history
Changed in upstream django.
  • Loading branch information
francoisfreitag committed Oct 4, 2023
1 parent 07696fc commit 50bcacb
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,13 @@ def test_values_with_null(self):


class PhoneNumberFieldAppTest(TestCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
# Drop alias with support for Django 3.2.
if django.VERSION < (4, 2):
cls.assertQuerySetEqual = cls.assertQuerysetEqual

def test_save_field_to_database(self):
"""Basic Field Test"""
tm = models.TestModel()
Expand All @@ -303,7 +310,7 @@ def test_save_field_to_database(self):

tm = models.TestModel.objects.get(pk=pk)
self.assertIsInstance(tm.phone, PhoneNumber)
self.assertQuerysetEqual(
self.assertQuerySetEqual(
models.TestModel.objects.all(),
[(tm.pk, "", "+41524242424")],
transform=phone_transform,
Expand Down Expand Up @@ -343,7 +350,7 @@ def test_save_blank_phone_to_database(self):

pk = tm.id
tm = models.TestModelPhoneB.objects.get(pk=pk)
self.assertQuerysetEqual(
self.assertQuerySetEqual(
models.TestModelPhoneB.objects.all(),
[(tm.pk, "", "")],
transform=phone_transform,
Expand All @@ -357,7 +364,7 @@ def __test_nullable_field_helper(self, TestModel):
pk = tm.id
tm = TestModel.objects.get(pk=pk)
self.assertIsNone(tm.phone)
self.assertQuerysetEqual(
self.assertQuerySetEqual(
TestModel.objects.all(), [(tm.pk, "", None)], transform=phone_transform
)

Expand Down Expand Up @@ -388,7 +395,7 @@ def __test_nullable_default_field_helper(self, TestModel):

pk = tm.id
tm = TestModel.objects.get(pk=pk)
self.assertQuerysetEqual(
self.assertQuerySetEqual(
TestModel.objects.all(),
[(tm.pk, "", "+41524242424")],
transform=phone_transform,
Expand All @@ -409,7 +416,7 @@ def __test_nullable_empty_default_field_helper(self, TestModel):

pk = tm.id
tm = TestModel.objects.get(pk=pk)
self.assertQuerysetEqual(
self.assertQuerySetEqual(
TestModel.objects.all(), [(tm.pk, "", "")], transform=phone_transform
)

Expand Down

0 comments on commit 50bcacb

Please sign in to comment.