mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #28176 -- Restored the uncasted option value in ChoiceWidget template context.
This commit is contained in:
@@ -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).
|
||||
|
||||
Reference in New Issue
Block a user