diff options
| author | Andrew Hankinson | 2012-12-16 14:49:18 -0500 |
|---|---|---|
| committer | Andrew Hankinson | 2012-12-16 14:49:18 -0500 |
| commit | 18338a37d356faebb0f59bd57b2ba876d66e6b73 (patch) | |
| tree | edb7894e715723c1b29ba8042be0c3d6a687b312 /rest_framework/tests/generics.py | |
| parent | 4f96951be9800cfc1fc67795a26d11ac66abc60d (diff) | |
| download | django-rest-framework-18338a37d356faebb0f59bd57b2ba876d66e6b73.tar.bz2 | |
Adding PATCH support to Django REST Framework
Diffstat (limited to 'rest_framework/tests/generics.py')
| -rw-r--r-- | rest_framework/tests/generics.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/rest_framework/tests/generics.py b/rest_framework/tests/generics.py index a8279ef2..1b55a3a5 100644 --- a/rest_framework/tests/generics.py +++ b/rest_framework/tests/generics.py @@ -180,6 +180,19 @@ class TestInstanceView(TestCase): updated = self.objects.get(id=1) self.assertEquals(updated.text, 'foobar') + # def test_patch_instance_view(self): + # """ + # PATCH requests to RetrieveUpdateDestroyAPIView should update an object. + # """ + # content = {'text': 'foobar'} + # request = factory.patch('/1', json.dumps(content), + # content_type='application/json') + # response = self.view(request, pk=1).render() + # self.assertEquals(response.status_code, status.HTTP_200_OK) + # self.assertEquals(response.data, {'id': 1, 'text': 'foobar'}) + # updated = self.objects.get(id=1) + # self.assertEquals(updated.text, 'foobar') + def test_delete_instance_view(self): """ DELETE requests to RetrieveUpdateDestroyAPIView should delete an object. |
