Add experimental API call to query idempotency logs

This commit is contained in:
Raphael Michel
2022-05-25 13:00:31 +02:00
parent d1644e62f0
commit 3790d04ed2
3 changed files with 96 additions and 2 deletions

View File

@@ -103,6 +103,19 @@ def test_ignore_path_method_body(token_client, organizer):
assert resp.status_code == 201
@pytest.mark.django_db
def test_query_key(token_client, organizer):
resp = token_client.post('/api/v1/organizers/{}/events/'.format(organizer.slug),
PAYLOAD, format='json', HTTP_X_IDEMPOTENCY_KEY='foo')
assert resp.status_code == 201
data = resp.content
resp = token_client.get('/api/v1/idempotency_query?key=foo')
assert resp.content == data
assert resp.status_code == 201
resp = token_client.get('/api/v1/idempotency_query?key=bar')
assert resp.status_code == 404
@pytest.mark.django_db
def test_scoped_by_token(token_client, device, organizer):
resp = token_client.post('/api/v1/organizers/{}/events/'.format(organizer.slug),