From 926e90132dc15d76bb8d16e2f9f1279566cac3c3 Mon Sep 17 00:00:00 2001 From: jpic Date: Mon, 25 Jan 2016 05:15:42 +0100 Subject: Fixed #25731 -- Removed unused choices kwarg for Select.render() --- tests/forms_tests/widget_tests/test_select.py | 44 +++++++--------------- .../widget_tests/test_selectmultiple.py | 20 +++++----- 2 files changed, 24 insertions(+), 40 deletions(-) (limited to 'tests/forms_tests') diff --git a/tests/forms_tests/widget_tests/test_select.py b/tests/forms_tests/widget_tests/test_select.py index 86ef355c62..185352cda3 100644 --- a/tests/forms_tests/widget_tests/test_select.py +++ b/tests/forms_tests/widget_tests/test_select.py @@ -10,14 +10,14 @@ from .base import WidgetTest class SelectTest(WidgetTest): - widget = Select() + widget = Select nested_widget = Select(choices=( ('outer1', 'Outer 1'), ('Group "1"', (('inner1', 'Inner 1'), ('inner2', 'Inner 2'))), )) def test_render(self): - self.check_html(self.widget, 'beatle', 'J', choices=self.beatles, html=( + self.check_html(self.widget(choices=self.beatles), 'beatle', 'J', html=( """ @@ -44,7 +44,7 @@ class SelectTest(WidgetTest): If the value corresponds to a label (but not to an option value), none of the options are selected. """ - self.check_html(self.widget, 'beatle', 'John', choices=self.beatles, html=( + self.check_html(self.widget(choices=self.beatles), 'beatle', 'John', html=( """ @@ -90,8 +90,8 @@ class SelectTest(WidgetTest): The value is compared to its str(). """ self.check_html( - self.widget, 'num', 2, - choices=[('1', '1'), ('2', '2'), ('3', '3')], + self.widget(choices=[('1', '1'), ('2', '2'), ('3', '3')]), + 'num', 2, html=( """ @@ -112,8 +112,8 @@ class SelectTest(WidgetTest): ), ) self.check_html( - self.widget, 'num', 2, - choices=[(1, 1), (2, 2), (3, 3)], + self.widget(choices=[(1, 1), (2, 2), (3, 3)]), + 'num', 2, html=( """""" )) - def test_choices_constuctor_and_render(self): - """ - If 'choices' is passed to both the constructor and render(), then - they'll both be in the output. - """ - widget = Select(choices=[(1, 1), (2, 2), (3, 3)]) - self.check_html(widget, 'num', 2, choices=[(4, 4), (5, 5)], html=( - """""" - )) - def test_choices_escaping(self): choices = (('bad', 'you & me'), ('good', mark_safe('you > me'))) - self.check_html(self.widget, 'escape', None, choices=choices, html=( + self.check_html(self.widget(choices=choices), 'escape', None, html=( """ @@ -31,7 +31,7 @@ class SelectMultipleTest(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=( """ @@ -58,7 +58,7 @@ class SelectMultipleTest(WidgetTest): """ Multiple options with the same value can be selected (#8103). """ - self.check_html(self.widget, 'choices', ['0'], choices=self.numeric_choices, html=( + self.check_html(self.widget(choices=self.numeric_choices), 'choices', ['0'], html=( """ @@ -85,7 +85,7 @@ class SelectMultipleTest(WidgetTest): def test_compare_string(self): choices = [('1', '1'), ('2', '2'), ('3', '3')] - self.check_html(self.widget, 'nums', [2], choices=choices, html=( + self.check_html(self.widget(choices=choices), 'nums', [2], html=( """""" )) - self.check_html(self.widget, 'nums', ['2'], choices=choices, html=( + self.check_html(self.widget(choices=choices), 'nums', ['2'], html=( """""" )) - self.check_html(self.widget, 'nums', [2], choices=choices, html=( + self.check_html(self.widget(choices=choices), 'nums', [2], html=( """