Skip to content

Commit

Permalink
Refs #3235 - Test demonstrating a single value passed to ListField is…
Browse files Browse the repository at this point in the history
… lost.
  • Loading branch information
kezabelle committed Aug 7, 2015
1 parent 981265f commit 08d60f5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,14 @@ class TestSerializer(serializers.Serializer):
assert serializer.is_valid()
assert serializer.validated_data == {'scores': [1, 3]}

def test_querydict_list_input_only_one_input(self):
class TestSerializer(serializers.Serializer):
scores = serializers.ListField(child=serializers.IntegerField())

serializer = TestSerializer(data=QueryDict('scores=1&'))
assert serializer.is_valid()
assert serializer.validated_data == {'scores': [1]}


class TestCreateOnlyDefault:
def setup(self):
Expand Down

0 comments on commit 08d60f5

Please sign in to comment.