def step_impl(context): response = context.response json = get_json(response) assert response.status_code == 200 assert json['success'] is True assert json['data']['name'] == 'Soccer'
def step_impl(context): response = context.response json = get_json(response) assert len(json['data']) == 2 assert json['data'][0]['slug'] == 'item-3' assert json['data'][1]['slug'] == 'item-2'
def after_scenario(context, scenario): # Remove all items response = context.client.get('/items') json = get_json(response) ids = [item['id'] for item in json['data']] responses = remove_items(ids, client=context.client) for response in responses: assert response.status_code == 200
def step_impl(context): response = context.response json = get_json(response) assert json['success'] is True assert len(json['data']) == 9
def step_impl(context): response = context.response json = get_json(response) assert json['data']['slug'] == 'item-1' assert json['data']['category']['id'] == 1