diff options
author | django-bot <ops@djangoproject.com> | 2022-02-03 20:24:19 +0100 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-02-07 20:37:05 +0100 |
commit | 9c19aff7c7561e3a82978a272ecdaad40dda5c00 (patch) | |
tree | f0506b668a013d0063e5fba3dbf4863b466713ba /tests/max_lengths | |
parent | f68fa8b45dfac545cfc4111d4e52804c86db68d3 (diff) | |
download | django-9c19aff7c7561e3a82978a272ecdaad40dda5c00.tar.gz |
Refs #33476 -- Reformatted code with Black.
Diffstat (limited to 'tests/max_lengths')
-rw-r--r-- | tests/max_lengths/tests.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/max_lengths/tests.py b/tests/max_lengths/tests.py index dfea552fad..f2ef8b25d1 100644 --- a/tests/max_lengths/tests.py +++ b/tests/max_lengths/tests.py @@ -6,35 +6,35 @@ from .models import PersonWithCustomMaxLengths, PersonWithDefaultMaxLengths class MaxLengthArgumentsTests(unittest.TestCase): - def verify_max_length(self, model, field, length): self.assertEqual(model._meta.get_field(field).max_length, length) def test_default_max_lengths(self): - self.verify_max_length(PersonWithDefaultMaxLengths, 'email', 254) - self.verify_max_length(PersonWithDefaultMaxLengths, 'vcard', 100) - self.verify_max_length(PersonWithDefaultMaxLengths, 'homepage', 200) - self.verify_max_length(PersonWithDefaultMaxLengths, 'avatar', 100) + self.verify_max_length(PersonWithDefaultMaxLengths, "email", 254) + self.verify_max_length(PersonWithDefaultMaxLengths, "vcard", 100) + self.verify_max_length(PersonWithDefaultMaxLengths, "homepage", 200) + self.verify_max_length(PersonWithDefaultMaxLengths, "avatar", 100) def test_custom_max_lengths(self): - self.verify_max_length(PersonWithCustomMaxLengths, 'email', 250) - self.verify_max_length(PersonWithCustomMaxLengths, 'vcard', 250) - self.verify_max_length(PersonWithCustomMaxLengths, 'homepage', 250) - self.verify_max_length(PersonWithCustomMaxLengths, 'avatar', 250) + self.verify_max_length(PersonWithCustomMaxLengths, "email", 250) + self.verify_max_length(PersonWithCustomMaxLengths, "vcard", 250) + self.verify_max_length(PersonWithCustomMaxLengths, "homepage", 250) + self.verify_max_length(PersonWithCustomMaxLengths, "avatar", 250) class MaxLengthORMTests(TestCase): - def test_custom_max_lengths(self): args = { "email": "someone@example.com", "vcard": "vcard", "homepage": "http://example.com/", - "avatar": "me.jpg" + "avatar": "me.jpg", } for field in ("email", "vcard", "homepage", "avatar"): new_args = args.copy() - new_args[field] = "X" * 250 # a value longer than any of the default fields could hold. + new_args[field] = ( + "X" * 250 + ) # a value longer than any of the default fields could hold. p = PersonWithCustomMaxLengths.objects.create(**new_args) self.assertEqual(getattr(p, field), ("X" * 250)) |