瀏覽代碼

In the API, return Pin resource upon creation

Fixes #68
tags/v1.0.0
Krzysztof Klimonda 11 年之前
父節點
當前提交
974d2a8720
共有 2 個文件被更改,包括 2 次插入0 次删除
  1. +1
    -0
      pinry/api/api.py
  2. +1
    -0
      pinry/api/tests.py

+ 1
- 0
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()

+ 1
- 0
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)


Loading…
取消
儲存