Merged spool price testing into existing test methods

This commit is contained in:
pdsccode
2024-01-07 14:24:14 +01:00
parent 05dfb611cf
commit 28a70d5190
2 changed files with 6 additions and 44 deletions

View File

@@ -19,6 +19,7 @@ def test_add_spool_remaining_weight(random_filament: dict[str, Any]):
lot_nr = "123456789"
comment = "abcdefghåäö"
archived = True
price = 25
result = httpx.post(
f"{URL}/api/v1/spool",
json={
@@ -30,6 +31,7 @@ def test_add_spool_remaining_weight(random_filament: dict[str, Any]):
"lot_nr": lot_nr,
"comment": comment,
"archived": archived,
"price": price,
},
)
result.raise_for_status()
@@ -62,6 +64,7 @@ def test_add_spool_remaining_weight(random_filament: dict[str, Any]):
"lot_nr": lot_nr,
"comment": comment,
"archived": archived,
"price": price,
}
# Verify that registered happened almost now (within 1 minute)
@@ -185,16 +188,3 @@ def test_add_spool_both_used_and_remaining_weight(random_filament: dict[str, Any
},
)
assert result.status_code == 400 # Cannot set both used and remaining weight
def test_add_spool_price(random_filament: dict[str, Any]):
"""Test adding a spool to the database."""
# Execute
result = httpx.post(
f"{URL}/api/v1/spool",
json={
"filament_id": random_filament["id"],
"price": 25,
},
)
assert result.status_code == 400 # Cannot set price