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

Refactor deprecated unittest aliases for Python 3.11 compatibility. #41

Merged
merged 1 commit into from
Mar 27, 2022
Merged
Show file tree
Hide file tree
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
12 changes: 6 additions & 6 deletions tests/test_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class AttributesFieldsTestCase(TestCase):
def test_attributes_form_field(self):
field = AttributesFormField()
# to_python method
self.assertEquals(field.to_python({"test": True}), {"test": True})
self.assertEqual(field.to_python({"test": True}), {"test": True})
with self.assertRaises(ValidationError):
field.to_python("no json")
# validate method
Expand All @@ -79,28 +79,28 @@ def test_attributes_form_field(self):
def test_attributes_field(self):
field = AttributesField(null=True, default={"my": "default"})
# formfield method
self.assertEquals(field.formfield().initial, {"my": "default"})
self.assertEqual(field.formfield().initial, {"my": "default"})
# from_db_value method
self.assertIsNone(field.from_db_value(None))
self.assertEquals(
self.assertEqual(
field.from_db_value('{"test": "test"}'),
{"test": "test"},
)
self.assertEquals(
self.assertEqual(
field.from_db_value({"test": "test"}),
{"test": "test"},
)
# get_db_prep_value method
self.assertIsNone(field.get_db_prep_value(None))
field.null = False
field.blank = True
self.assertEquals(field.get_db_prep_value(None), "")
self.assertEqual(field.get_db_prep_value(None), "")
# get_default method
field = AttributesField(default='{"my": "default"}')
field.default = NOT_PROVIDED
field.get_default()
# get_internal_type method
self.assertEquals(field.get_internal_type(), "TextField")
self.assertEqual(field.get_internal_type(), "TextField")
# validate method
with self.assertRaises(ValidationError):
field.validate(None, Noop)
2 changes: 1 addition & 1 deletion tests/test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_plugin_form(self):
warnings.simplefilter("ignore")
response = self.client.post(request_url, data)

self.assertEquals(response.status_code, 200)
self.assertEqual(response.status_code, 200)
self.assertContains(response, '<div class="success">')

# test error for excluded keys
Expand Down