'Posting a new detail with one related object, referenced via its
``resource_uri`` should require two queries: one to save the
object, and one to lookup the related object.'

def test_two_queries_for_post_list(self):

    parent = Category.objects.create(name='Bar')
    resource = api.canonical_resource_for('category')
    request = MockRequest()
    body = json.dumps({'name': 'Foo', 'parent': resource.get_resource_uri(parent)})
    request.set_body(body)
    with self.assertNumQueries(2):
        resource.post_list(request)
