diff options
| author | Tim Graham <timograham@gmail.com> | 2014-08-02 18:33:18 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-08-03 11:21:01 -0400 |
| commit | 0f2ceee0254349ee4ac7d472d3efe67ee161a917 (patch) | |
| tree | 557f664c5fc08c1b85f213b62c98f1ad776a7bf1 /tests/forms_tests | |
| parent | 44169a00c1fe7c130a8b9774e3b02ccce524a3eb (diff) | |
Fixed #23151 -- Deprecated RegexField.error_message.
Thanks Baptiste Mispelon for the suggestion.
Diffstat (limited to 'tests/forms_tests')
| -rw-r--r-- | tests/forms_tests/tests/test_fields.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/forms_tests/tests/test_fields.py b/tests/forms_tests/tests/test_fields.py index 0b82b3940b..b7786adf00 100644 --- a/tests/forms_tests/tests/test_fields.py +++ b/tests/forms_tests/tests/test_fields.py @@ -32,6 +32,7 @@ import re import os from decimal import Decimal from unittest import skipIf +import warnings try: from PIL import Image @@ -630,7 +631,10 @@ class FieldsTests(SimpleTestCase): self.assertRaisesMessage(ValidationError, "'Enter a valid value.'", f.clean, '2A2 ') def test_regexfield_4(self): - f = RegexField('^[0-9][0-9][0-9][0-9]$', error_message='Enter a four-digit number.') + # deprecated error_message argument; remove in Django 2.0 + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter("always") + f = RegexField('^[0-9][0-9][0-9][0-9]$', error_message='Enter a four-digit number.') self.assertEqual('1234', f.clean('1234')) self.assertRaisesMessage(ValidationError, "'Enter a four-digit number.'", f.clean, '123') self.assertRaisesMessage(ValidationError, "'Enter a four-digit number.'", f.clean, 'abcd') |
