summaryrefslogtreecommitdiff
path: root/tests/forms_tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/forms_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):