Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename assertQuery{s,S}etEqual in tests #578

Merged
merged 1 commit into from
Oct 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading