summaryrefslogtreecommitdiff
path: root/tests/postgres_tests/test_array.py
diff options
context:
space:
mode:
authorDražen Odobašić <dodobas@candela-it.com>2015-09-11 19:33:12 -0400
committerTim Graham <timograham@gmail.com>2015-09-12 11:40:50 -0400
commitb1e33ceceda1e75ff68c7deed8f6659683a195d3 (patch)
treee4e446f69194f2dc3c9c7ee3ecf48290ea8d4d31 /tests/postgres_tests/test_array.py
parent84b0a8d2aad042fb573df5055b6153770d0929ac (diff)
Fixed #23395 -- Limited line lengths to 119 characters.
Diffstat (limited to 'tests/postgres_tests/test_array.py')
-rw-r--r--tests/postgres_tests/test_array.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/postgres_tests/test_array.py b/tests/postgres_tests/test_array.py
index 09ae4e8546..fbc15bb2ac 100644
--- a/tests/postgres_tests/test_array.py
+++ b/tests/postgres_tests/test_array.py
@@ -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):