diff options
| author | Tim Heap <tim@ionata.com.au> | 2013-08-05 10:01:49 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-08-05 10:13:48 -0400 |
| commit | 891cdf120a0751b71eb534e14f814f574904ec44 (patch) | |
| tree | 37ca26a29da508e85205a806b6c38b57191cce37 /tests/forms_tests | |
| parent | ea7bef318fd42411e3db057e888367ef52fb23c3 (diff) | |
[1.6.x] Fixed #20850 -- Added MultiWidget.needs_multipart_form
Backport of 75c87e2d38 from master
Diffstat (limited to 'tests/forms_tests')
| -rw-r--r-- | tests/forms_tests/tests/test_widgets.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/forms_tests/tests/test_widgets.py b/tests/forms_tests/tests/test_widgets.py index 4c566dc8e4..06ee2d6c53 100644 --- a/tests/forms_tests/tests/test_widgets.py +++ b/tests/forms_tests/tests/test_widgets.py @@ -849,6 +849,14 @@ beatle J R Ringo False""") w = MyMultiWidget(widgets=(TextInput(attrs={'class': 'big'}), TextInput(attrs={'class': 'small'})), attrs={'id': 'bar'}) self.assertHTMLEqual(w.render('name', ['john', 'lennon']), '<input id="bar_0" type="text" class="big" value="john" name="name_0" /><br /><input id="bar_1" type="text" class="small" value="lennon" name="name_1" />') + # Test needs_multipart_form=True if any widget needs it + w = MyMultiWidget(widgets=(TextInput(), FileInput())) + self.assertTrue(w.needs_multipart_form) + + # Test needs_multipart_form=False if no widget needs it + w = MyMultiWidget(widgets=(TextInput(), TextInput())) + self.assertFalse(w.needs_multipart_form) + def test_splitdatetime(self): w = SplitDateTimeWidget() self.assertHTMLEqual(w.render('date', ''), '<input type="text" name="date_0" /><input type="text" name="date_1" />') |
