summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-04-15 13:01:38 -0400
committerTim Graham <timograham@gmail.com>2017-04-17 08:32:29 -0400
commitc09bf8d76770d39a4d9545b67598cd05adee281b (patch)
tree209391e0482730712a18d450d72b654b985e7158 /tests
parente5dce7b0fbd2965e524ce97114f501319ec2bb6f (diff)
Fixed #28058 -- Restored empty BoundFields evaluating to True.
Regression in b52c73008a9d67e9ddbb841872dc15cdd3d6ee01
Diffstat (limited to 'tests')
-rw-r--r--tests/forms_tests/tests/test_forms.py7
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 2466bbc67b..9f32953b47 100644
--- a/tests/forms_tests/tests/test_forms.py
+++ b/tests/forms_tests/tests/test_forms.py
@@ -746,6 +746,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):