Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Feb 4, 2024
1 parent 24cc3d7 commit 13c2e31
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def create_price(
background_tasks.add_task(tasks.create_price_product, db, price=db_price)
background_tasks.add_task(tasks.create_price_location, db, price=db_price)
background_tasks.add_task(tasks.increment_user_price_count, db, user=current_user)
if proof:
if price.proof_id and proof:
background_tasks.add_task(tasks.increment_proof_price_count, db, proof=proof)
return db_price

Expand Down
2 changes: 2 additions & 0 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@ def test_get_proofs(user_session: SessionModel):
"owner",
"created",
"is_public",
"price_count",
}

for i, item in enumerate(data):
Expand All @@ -628,6 +629,7 @@ def test_get_proofs(user_session: SessionModel):
assert item["type"] == ("PRICE_TAG" if i == 0 else "RECEIPT")
assert item["owner"] == "user"
assert item["is_public"] == (True if i == 0 else False)
assert item["price_count"] == 0


def test_get_proofs_filters(db_session, user_session: SessionModel):
Expand Down

0 comments on commit 13c2e31

Please sign in to comment.