Skip to content

Commit ab9ab40

Browse files
remove unused import and test product with no query param
1 parent a4d32d6 commit ab9ab40

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/test_product.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from urllib.parse import quote
2-
31
import pytest
42

53
from app.models import Product
@@ -141,6 +139,10 @@ def test_get_product_by_name(self, create_product, name):
141139
not_found_resp = self.client.get("/product", query_string={"name": "Non existent product"})
142140
assert not_found_resp.status_code == 404
143141

142+
def test_get_product_by_name_missing_param_returns_400(self):
143+
resp = self.client.get("/product") # no query param
144+
assert resp.status_code == 400
145+
144146
@pytest.mark.parametrize(
145147
"get_headers, expected_code",
146148
[

0 commit comments

Comments
 (0)