From 974d2a87206ef3fe4a202c984a17dac73d498fe9 Mon Sep 17 00:00:00 2001 From: Krzysztof Klimonda Date: Tue, 26 Feb 2013 02:10:08 -0800 Subject: [PATCH] In the API, return Pin resource upon creation Fixes #68 --- pinry/api/api.py | 1 + pinry/api/tests.py | 1 + 2 files changed, 2 insertions(+) diff --git a/pinry/api/api.py b/pinry/api/api.py index 81789ae..88c73d3 100644 --- a/pinry/api/api.py +++ b/pinry/api/api.py @@ -84,4 +84,5 @@ class PinResource(ModelResource): queryset = Pin.objects.all() resource_name = 'pin' include_resource_uri = False + always_return_data = True authorization = DjangoAuthorization() diff --git a/pinry/api/tests.py b/pinry/api/tests.py index 63c7807..89a5638 100644 --- a/pinry/api/tests.py +++ b/pinry/api/tests.py @@ -79,6 +79,7 @@ class PinResourceTest(ResourceTestCase): 'tags': ['random', 'tags'], } response = self.api_client.post('/api/v1/pin/', data=post_data) + self.assertEqual(self.deserialize(response)['id'], 3) self.assertHttpCreated(response) # A number of Image objects should stay the same as we are using an existing image self.assertEqual(Image.objects.count(), 2)