Skip to content

Commit

Permalink
Add test for GET /proofs
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Nov 15, 2023
1 parent 241551f commit d3920b1
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def test_hello():
assert response.status_code == 200


def test_create_price_must_be_authenticated(user, db=override_get_db()):
def test_create_price(user, db=override_get_db()):
# without authentication
response = client.post(
"/prices",
Expand Down Expand Up @@ -126,3 +126,15 @@ def test_get_prices_filters():
response = client.get("/prices?date=2023-10-31")
assert response.status_code == 200
assert len(response.json()["items"]) == 1


def test_get_proofs(user):
# without authentication
response = client.get("/proofs")
assert response.status_code == 401
# with authentication
response = client.get(
"/proofs",
headers={"Authorization": f"Bearer {user.token}"},
)
assert response.status_code == 200

0 comments on commit d3920b1

Please sign in to comment.