diff options
| author | Kit La Touche <kit@simpleenergy.com> | 2014-07-29 11:04:13 -0600 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-07-29 19:55:55 -0400 |
| commit | 17e75d03f92cff7d1d5d4679a8a09b13e08f3264 (patch) | |
| tree | a453021f7f0a254599d767acb2a660431708a1d6 /tests | |
| parent | 096a5de5d2bf564f859eca115874f5643ef31658 (diff) | |
Fixed #23129 -- Added 'true' and 'false' to `NullBooleanField`.
JavaScript serializations of forms will sometimes render the boolean
values as the strings 'true' and 'false', in lower case. Rather than
repeat boilerplate in the JavaScript to circumvent this, it seems
reasonable to allow Django to understand the lower-case versions of the
booleans.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/forms_tests/tests/test_fields.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/forms_tests/tests/test_fields.py b/tests/forms_tests/tests/test_fields.py index 1a6286451e..2482fe0682 100644 --- a/tests/forms_tests/tests/test_fields.py +++ b/tests/forms_tests/tests/test_fields.py @@ -1000,6 +1000,8 @@ class FieldsTests(SimpleTestCase): self.assertEqual(None, f.clean('2')) self.assertEqual(None, f.clean('3')) self.assertEqual(None, f.clean('hello')) + self.assertEqual(True, f.clean('true')) + self.assertEqual(False, f.clean('false')) def test_nullbooleanfield_2(self): # Make sure that the internal value is preserved if using HiddenInput (#7753) |
