mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
[1.11.x] Fixed #28176 -- Restored the uncasted option value in ChoiceWidget template context.
Backport of 221e6e1817 from master
This commit is contained in:
@@ -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).
|
||||
|
||||
Reference in New Issue
Block a user