diff --git a/tests/tests.py b/tests/tests.py index ea1260f9..51f17e5a 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -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() @@ -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, @@ -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, @@ -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 ) @@ -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, @@ -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 )