summaryrefslogtreecommitdiff
path: root/tests/postgres_tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-10-26 19:37:47 -0400
committerTim Graham <timograham@gmail.com>2015-10-27 08:13:27 -0400
commit69e6045ceb18d859a1586bcd5e64f9b786d87c32 (patch)
tree01baff5ac92181dca86dc411dc6379b55328cec2 /tests/postgres_tests
parent6b631b5c0bd88f7868308b966e8117b8da335669 (diff)
[1.8.x] Fixed #25597 -- Fixed crash with SplitArrayField and IntegerField on invalid value.
Backport of 1f07da3e29c7c3d47968e1c4531dd9bf902575b7 from master
Diffstat (limited to 'tests/postgres_tests')
-rw-r--r--tests/postgres_tests/test_array.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/postgres_tests/test_array.py b/tests/postgres_tests/test_array.py
index 589982342e..d85c0f58ec 100644
--- a/tests/postgres_tests/test_array.py
+++ b/tests/postgres_tests/test_array.py
@@ -484,6 +484,11 @@ class TestSplitFormField(TestCase):
self.assertFalse(form.is_valid())
self.assertEqual(form.errors, {'array': ['Item 2 in the array did not validate: This field is required.']})
+ def test_invalid_integer(self):
+ msg = 'Item 1 in the array did not validate: Ensure this value is less than or equal to 100.'
+ with self.assertRaisesMessage(exceptions.ValidationError, msg):
+ SplitArrayField(forms.IntegerField(max_value=100), size=2).clean([0, 101])
+
def test_rendering(self):
class SplitForm(forms.Form):
array = SplitArrayField(forms.CharField(), size=3)