Commit 5a95baf2 by Tom Christie

Tests & tweaks for ChoiceField

parent b5454dd0
......@@ -769,7 +769,9 @@ class MultipleChoiceField(ChoiceField):
])
def to_representation(self, value):
return [self.choice_strings_to_values[str(item)] for item in value]
return set([
self.choice_strings_to_values[str(item)] for item in value
])
# File types...
......
......@@ -577,7 +577,9 @@ class TestMultipleChoiceField(FieldValues):
'abc': ['Expected a list of items but got type `str`'],
('aircon', 'incorrect'): ['`incorrect` is not a valid choice.']
}
outputs = {}
outputs = [
(['aircon', 'manual'], set(['aircon', 'manual']))
]
field = fields.MultipleChoiceField(
choices=[
('aircon', 'AirCon'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment