Changeset View
Changeset View
Standalone View
Standalone View
swh/web/tests/api/views/test_content.py
Show First 20 Lines • Show All 111 Lines • ▼ Show 20 Lines | for entry in rv.data: | ||||
assert entry == expected_entry | assert entry == expected_entry | ||||
assert 'Link' not in rv | assert 'Link' not in rv | ||||
url = reverse('api-1-content-symbol', | url = reverse('api-1-content-symbol', | ||||
url_args={'q': contents_with_ctags['symbol_name']}, | url_args={'q': contents_with_ctags['symbol_name']}, | ||||
query_params={'per_page': 2}) | query_params={'per_page': 2}) | ||||
rv = api_client.get(url) | rv = api_client.get(url) | ||||
next_url = reverse('api-1-content-symbol', | next_url = rv.wsgi_request.build_absolute_uri( | ||||
reverse('api-1-content-symbol', | |||||
url_args={'q': contents_with_ctags['symbol_name']}, | url_args={'q': contents_with_ctags['symbol_name']}, | ||||
query_params={'last_sha1': rv.data[1]['sha1'], | query_params={'last_sha1': rv.data[1]['sha1'], | ||||
'per_page': 2}) | 'per_page': 2})) | ||||
assert rv['Link'] == '<%s>; rel="next"' % next_url | assert rv['Link'] == '<%s>; rel="next"' % next_url | ||||
def test_api_content_symbol_not_found(api_client): | def test_api_content_symbol_not_found(api_client): | ||||
url = reverse('api-1-content-symbol', url_args={'q': 'bar'}) | url = reverse('api-1-content-symbol', url_args={'q': 'bar'}) | ||||
rv = api_client.get(url) | rv = api_client.get(url) | ||||
assert rv.status_code == 404, rv.data | assert rv.status_code == 404, rv.data | ||||
▲ Show 20 Lines • Show All 249 Lines • Show Last 20 Lines |