diff options
| author | Tim Graham <timograham@gmail.com> | 2017-06-15 11:05:21 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-06-17 18:33:01 -0400 |
| commit | a3b1319d5863600981e71fbaa452d7104715a9e7 (patch) | |
| tree | 9cf4cf6fc7e33071914580f4c32aaba040d6cf7c /tests/forms_tests | |
| parent | f0ec88fb63f39db38ab027477167f9d7a7ea151c (diff) | |
[1.11.x] Fixed #28176 -- Restored the uncasted option value in ChoiceWidget template context.
Backport of 221e6e18177516ac4ac95e40c344b93d14dd607b from master
Diffstat (limited to 'tests/forms_tests')
| -rw-r--r-- | tests/forms_tests/widget_tests/test_select.py | 6 |
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 d366d29ff3..13dc5ea669 100644 --- a/tests/forms_tests/widget_tests/test_select.py +++ b/tests/forms_tests/widget_tests/test_select.py @@ -351,6 +351,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). |
