From 79736e516a68f567c16e33e03f4e4f90f1029da0 Mon Sep 17 00:00:00 2001 From: Brian Grohe Date: Wed, 17 Jun 2015 13:18:50 -0400 Subject: [PATCH] Added failing test case Adding failing test case when many=false is explicitly defined https://github.com/tomchristie/django-rest-framework/issues/3042 --- tests/test_relations.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_relations.py b/tests/test_relations.py index a4815a06d..6c6543154 100644 --- a/tests/test_relations.py +++ b/tests/test_relations.py @@ -48,6 +48,11 @@ class TestPrimaryKeyRelatedField(APISimpleTestCase): representation = self.field.to_representation(self.instance) assert representation == self.instance.pk + def test_explicit_many_false(self): + field = serializers.PrimaryKeyRelatedField(queryset=self.queryset, many=False) + instance = field.to_internal_value(self.instance.pk) + assert instance is self.instance + class TestProxiedPrimaryKeyRelatedField(APISimpleTestCase): def setUp(self):