From a002bb5c67a8d033463d30ea6527fb2825b61adf Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Fri, 26 May 2017 09:25:43 +0200 Subject: [PATCH] Fixed test_hyperlinked_related_lookup_url_encoded_exists. Space character ' ' is prohibited in IRIs, therefore we shouldn't rely on encoding '%20' to ' ' in the HyperlinkedRelatedField tests. --- tests/test_relations.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_relations.py b/tests/test_relations.py index c903ee557..1868374fc 100644 --- a/tests/test_relations.py +++ b/tests/test_relations.py @@ -96,7 +96,7 @@ class TestHyperlinkedRelatedField(APISimpleTestCase): def setUp(self): self.queryset = MockQueryset([ MockObject(pk=1, name='foobar'), - MockObject(pk=2, name='baz qux'), + MockObject(pk=2, name='bazABCqux'), ]) self.field = serializers.HyperlinkedRelatedField( view_name='example', @@ -116,7 +116,7 @@ class TestHyperlinkedRelatedField(APISimpleTestCase): assert instance is self.queryset.items[0] def test_hyperlinked_related_lookup_url_encoded_exists(self): - instance = self.field.to_internal_value('http://example.org/example/baz%20qux/') + instance = self.field.to_internal_value('http://example.org/example/baz%41%42%43qux/') assert instance is self.queryset.items[1] def test_hyperlinked_related_lookup_does_not_exist(self):