mirror of
https://github.com/django/django.git
synced 2025-08-27 05:54:28 +00:00
Fixed #23395 -- Limited line lengths to 119 characters.
This commit is contained in:
parent
84b0a8d2aa
commit
b1e33ceced
130 changed files with 5259 additions and 1501 deletions
|
@ -341,7 +341,9 @@ class TestMigrations(TransactionTestCase):
|
|||
|
||||
|
||||
class TestSerialization(PostgreSQLTestCase):
|
||||
test_data = '[{"fields": {"field": "[\\"1\\", \\"2\\"]"}, "model": "postgres_tests.integerarraymodel", "pk": null}]'
|
||||
test_data = (
|
||||
'[{"fields": {"field": "[\\"1\\", \\"2\\"]"}, "model": "postgres_tests.integerarraymodel", "pk": null}]'
|
||||
)
|
||||
|
||||
def test_dumping(self):
|
||||
instance = IntegerArrayModel(field=[1, 2])
|
||||
|
@ -360,7 +362,10 @@ class TestValidation(PostgreSQLTestCase):
|
|||
with self.assertRaises(exceptions.ValidationError) as cm:
|
||||
field.clean([1, None], None)
|
||||
self.assertEqual(cm.exception.code, 'item_invalid')
|
||||
self.assertEqual(cm.exception.message % cm.exception.params, 'Item 1 in the array did not validate: This field cannot be null.')
|
||||
self.assertEqual(
|
||||
cm.exception.message % cm.exception.params,
|
||||
'Item 1 in the array did not validate: This field cannot be null.'
|
||||
)
|
||||
|
||||
def test_blank_true(self):
|
||||
field = ArrayField(models.IntegerField(blank=True, null=True))
|
||||
|
@ -388,7 +393,10 @@ class TestValidation(PostgreSQLTestCase):
|
|||
with self.assertRaises(exceptions.ValidationError) as cm:
|
||||
field.clean([0], None)
|
||||
self.assertEqual(cm.exception.code, 'item_invalid')
|
||||
self.assertEqual(cm.exception.messages[0], 'Item 0 in the array did not validate: Ensure this value is greater than or equal to 1.')
|
||||
self.assertEqual(
|
||||
cm.exception.messages[0],
|
||||
'Item 0 in the array did not validate: Ensure this value is greater than or equal to 1.'
|
||||
)
|
||||
|
||||
|
||||
class TestSimpleFormField(PostgreSQLTestCase):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue