From 96c2a28786daaeeebe07fb970602cace6958daf7 Mon Sep 17 00:00:00 2001 From: James Oakley Date: Tue, 27 Nov 2012 12:25:39 -0800 Subject: [PATCH] Removed commented code that uses the request factory and reworded the comment that explains why it isn't used --- rest_framework/tests/hyperlinkedserializers.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rest_framework/tests/hyperlinkedserializers.py b/rest_framework/tests/hyperlinkedserializers.py index 63b2cfcc9..df894fcc2 100644 --- a/rest_framework/tests/hyperlinkedserializers.py +++ b/rest_framework/tests/hyperlinkedserializers.py @@ -254,8 +254,6 @@ class TestOptionalRelationHyperlinkedView(TestCase): PUT requests to RetrieveUpdateDestroyAPIView with optional relations should accept None for non existing relations. """ - # Using the factory, the None somehow becomes u'None', which is not what happens in reality... - #request = factory.put('/optionalrelationmodel-detail/1', data=json.dumps(self.data)) - #response = self.detail_view(request, pk=1).render() + # Using the factory, the None incorrectly becomes u'None'. Use the normal test client instead response = self.client.put('/optionalrelation/1/', data=json.dumps(self.data), content_type='application/json') self.assertEqual(response.status_code, status.HTTP_200_OK)