In the API, return Pin resource upon creation

Fixes #68
This commit is contained in:
Krzysztof Klimonda
2013-02-26 02:10:08 -08:00
parent 82352d6980
commit 974d2a8720
2 changed files with 2 additions and 0 deletions

View File

@@ -84,4 +84,5 @@ class PinResource(ModelResource):
queryset = Pin.objects.all() queryset = Pin.objects.all()
resource_name = 'pin' resource_name = 'pin'
include_resource_uri = False include_resource_uri = False
always_return_data = True
authorization = DjangoAuthorization() authorization = DjangoAuthorization()

View File

@@ -79,6 +79,7 @@ class PinResourceTest(ResourceTestCase):
'tags': ['random', 'tags'], 'tags': ['random', 'tags'],
} }
response = self.api_client.post('/api/v1/pin/', data=post_data) response = self.api_client.post('/api/v1/pin/', data=post_data)
self.assertEqual(self.deserialize(response)['id'], 3)
self.assertHttpCreated(response) self.assertHttpCreated(response)
# A number of Image objects should stay the same as we are using an existing image # A number of Image objects should stay the same as we are using an existing image
self.assertEqual(Image.objects.count(), 2) self.assertEqual(Image.objects.count(), 2)