Esempio n. 1
0
    def test_single(self):
        response = PostResponder.respond(
            {'id': 1, 'title': 'A title'}
        )

        assert json.loads(response) == {
            'posts': {'id': 1, 'title': 'A title'}
        }
Esempio n. 2
0
    def test_single(self):
        response = PostResponder.respond({'id': 1, 'title': 'A title'})

        assert json.loads(response) == {
            'data': {
                'attributes': {
                    'title': 'A title'
                },
                'id': 1,
                'type': 'posts'
            },
            'jsonapi': JSONAPI_VERSION_DICT
        }