From 194c248150718413db38bc10acadb38c6f35d4ae Mon Sep 17 00:00:00 2001 From: Dhaval Mehta Date: Tue, 28 Jan 2020 02:41:15 +0530 Subject: [PATCH] add test cases to test de-duplication --- tests/schemas/test_openapi.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/schemas/test_openapi.py b/tests/schemas/test_openapi.py index 0774c9644..26909c5f5 100644 --- a/tests/schemas/test_openapi.py +++ b/tests/schemas/test_openapi.py @@ -68,6 +68,14 @@ class TestFieldMapping(TestCase): {'items': {'enum': [uuid1, uuid2]}, 'type': 'array'}), (serializers.ListField(child=serializers.ChoiceField(choices=[(1, 'One'), ('a', 'Choice A')])), {'items': {'enum': [1, 'a']}, 'type': 'array'}), + (serializers.ListField(child=serializers.ChoiceField(choices=[ + (1, 'One'), ('a', 'Choice A'), (1.1, 'First'), (1.1, 'First'), (1, 'One'), ('a', 'Choice A'), (1, 'One') + ])), + {'items': {'enum': [1, 'a', 1.1]}, 'type': 'array'}), + (serializers.ListField(child=serializers.ChoiceField(choices=[ + (1, 'One'), (2, 'Two'), (3, 'Three'), (2, 'Two'), (3, 'Three'), (1, 'One'), + ])), + {'items': {'enum': [1, 2, 3], 'type': 'integer'}, 'type': 'array'}), (serializers.IntegerField(min_value=2147483648), {'type': 'integer', 'minimum': 2147483648, 'format': 'int64'}), ]