예제 #1
0
    def it_serializes_errors(self):
        expected = {
                'collection': {
                    'error': {
                        'title': 'Error title',
                        'code': 404,
                        'message': 'Not found'
                        }
                    }
                }
        j = CollectionJsonSerializer.error(status=404, message='Not found',
                title='Error title')

        eq_(expected, json.loads(j))