diff options
| author | Tim Graham <timograham@gmail.com> | 2017-04-15 13:01:38 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-04-17 08:56:15 -0400 |
| commit | 844ae40a7cdcb1738ca3a2e8f13bb6b8c2e22efd (patch) | |
| tree | 41cea31c91366c29bd1f985aca02bdf2471e937e /tests | |
| parent | 91bbe7b1c1da16d51ec35a307762526c026b093a (diff) | |
[1.11.x] Fixed #28058 -- Restored empty BoundFields evaluating to True.
Regression in b52c73008a9d67e9ddbb841872dc15cdd3d6ee01
Backport of c09bf8d76770d39a4d9545b67598cd05adee281b from master
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/forms_tests/tests/test_forms.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/forms_tests/tests/test_forms.py b/tests/forms_tests/tests/test_forms.py index 2b93575bf2..ffad6f60a6 100644 --- a/tests/forms_tests/tests/test_forms.py +++ b/tests/forms_tests/tests/test_forms.py @@ -745,6 +745,13 @@ Java</label></li> [str(bf[1]), str(bf[2]), str(bf[3])], ) + def test_boundfield_bool(self): + """BoundField without any choices (subwidgets) evaluates to True.""" + class TestForm(Form): + name = ChoiceField(choices=[]) + + self.assertIs(bool(TestForm()['name']), True) + def test_forms_with_multiple_choice(self): # MultipleChoiceField is a special case, as its data is required to be a list: class SongForm(Form): |
