summaryrefslogtreecommitdiff
path: root/tests/forms_tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-06-15 11:05:21 -0400
committerTim Graham <timograham@gmail.com>2017-06-17 18:17:23 -0400
commit221e6e18177516ac4ac95e40c344b93d14dd607b (patch)
tree81b8b83ac56677b447493b0413aaaf6e7111f2a3 /tests/forms_tests
parentdc63ad7ac09ef694f19ae1d7496367614889e6fd (diff)
Fixed #28176 -- Restored the uncasted option value in ChoiceWidget template context.
Diffstat (limited to 'tests/forms_tests')
-rw-r--r--tests/forms_tests/widget_tests/test_select.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/forms_tests/widget_tests/test_select.py b/tests/forms_tests/widget_tests/test_select.py
index a5201e96e8..beba21fe2d 100644
--- a/tests/forms_tests/widget_tests/test_select.py
+++ b/tests/forms_tests/widget_tests/test_select.py
@@ -348,6 +348,12 @@ class SelectTest(WidgetTest):
)
self.assertEqual(index, 2)
+ def test_optgroups_integer_choices(self):
+ """The option 'value' is the same type as what's in `choices`."""
+ groups = list(self.widget(choices=[[0, 'choice text']]).optgroups('name', ['vhs']))
+ label, options, index = groups[0]
+ self.assertEqual(options[0]['value'], 0)
+
def test_deepcopy(self):
"""
__deepcopy__() should copy all attributes properly (#25085).