diff options
| author | Tim Graham <timograham@gmail.com> | 2016-04-28 18:48:52 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-04-28 18:48:52 -0400 |
| commit | 86573861a95e5a47dc7ff906443117d75b73dca1 (patch) | |
| tree | 3b142ae415417df6acab7851abf1d9c3c47f118a /tests/forms_tests/widget_tests/test_checkboxselectmultiple.py | |
| parent | f951bb78cbf179f0fb70fe74ae0c218925fd7ede (diff) | |
Refs #15667 -- Removed choices argument from some RendererMixin methods.
RendererMixin will soon be removed but this removal and the corresponding
test changes stand on their own.
Diffstat (limited to 'tests/forms_tests/widget_tests/test_checkboxselectmultiple.py')
| -rw-r--r-- | tests/forms_tests/widget_tests/test_checkboxselectmultiple.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/tests/forms_tests/widget_tests/test_checkboxselectmultiple.py b/tests/forms_tests/widget_tests/test_checkboxselectmultiple.py index 9e594fba37..1e9d31e6a7 100644 --- a/tests/forms_tests/widget_tests/test_checkboxselectmultiple.py +++ b/tests/forms_tests/widget_tests/test_checkboxselectmultiple.py @@ -4,10 +4,10 @@ from .base import WidgetTest class CheckboxSelectMultipleTest(WidgetTest): - widget = CheckboxSelectMultiple() + widget = CheckboxSelectMultiple def test_render_value(self): - self.check_html(self.widget, 'beatles', ['J'], choices=self.beatles, html=( + self.check_html(self.widget(choices=self.beatles), 'beatles', ['J'], html=( """<ul> <li><label><input checked="checked" type="checkbox" name="beatles" value="J" /> John</label></li> <li><label><input type="checkbox" name="beatles" value="P" /> Paul</label></li> @@ -17,7 +17,7 @@ class CheckboxSelectMultipleTest(WidgetTest): )) def test_render_value_multiple(self): - self.check_html(self.widget, 'beatles', ['J', 'P'], choices=self.beatles, html=( + self.check_html(self.widget(choices=self.beatles), 'beatles', ['J', 'P'], html=( """<ul> <li><label><input checked="checked" type="checkbox" name="beatles" value="J" /> John</label></li> <li><label><input checked="checked" type="checkbox" name="beatles" value="P" /> Paul</label></li> @@ -30,7 +30,7 @@ class CheckboxSelectMultipleTest(WidgetTest): """ If the value is None, none of the options are selected. """ - self.check_html(self.widget, 'beatles', None, choices=self.beatles, html=( + self.check_html(self.widget(choices=self.beatles), 'beatles', None, html=( """<ul> <li><label><input type="checkbox" name="beatles" value="J" /> John</label></li> <li><label><input type="checkbox" name="beatles" value="P" /> Paul</label></li> @@ -73,8 +73,8 @@ class CheckboxSelectMultipleTest(WidgetTest): </ul> """ self.check_html( - self.widget, 'nestchoice', ('vinyl', 'dvd'), - choices=nested_choices, attrs={'id': 'media'}, html=html, + self.widget(choices=nested_choices), 'nestchoice', ('vinyl', 'dvd'), + attrs={'id': 'media'}, html=html, ) def test_separate_ids(self): @@ -93,14 +93,13 @@ class CheckboxSelectMultipleTest(WidgetTest): </li> </ul> """ - self.check_html(self.widget, 'letters', ['a', 'c'], choices=choices, attrs={'id': 'abc'}, html=html) + self.check_html(self.widget(choices=choices), 'letters', ['a', 'c'], attrs={'id': 'abc'}, html=html) def test_separate_ids_constructor(self): """ Each input gets a separate ID when the ID is passed to the constructor. """ - widget = CheckboxSelectMultiple(attrs={'id': 'abc'}) - choices = [('a', 'A'), ('b', 'B'), ('c', 'C')] + widget = CheckboxSelectMultiple(attrs={'id': 'abc'}, choices=[('a', 'A'), ('b', 'B'), ('c', 'C')]) html = """ <ul id="abc"> <li> @@ -112,4 +111,4 @@ class CheckboxSelectMultipleTest(WidgetTest): </li> </ul> """ - self.check_html(widget, 'letters', ['a', 'c'], choices=choices, html=html) + self.check_html(widget, 'letters', ['a', 'c'], html=html) |
