def test_page(self): request = construct_dummy_request(matchdict={ 'slug': 'cat-or-dog', 'argument_id': 12, }) response = jump(request) verify_dictionary_of_view(response)
def test_page_on_failure(self): request = construct_dummy_request(matchdict={ 'slug': 'cat-or-dog', 'argument_id': 35, }) response = jump(request) self.assertEqual(400, response.status_code)
def jump_to_argument_fn(request): """ Jump directly to an argument to provoke user interaction. :param request: :return: Argument with a list of possible interactions """ request.validated["from_api"] = True response = jump(request) bubbles, items = extract_items_and_bubbles(response) return {'bubbles': bubbles, 'items': items}