Skip to content
Snippets Groups Projects
Commit 126121ab authored by Ruben.Havre's avatar Ruben.Havre
Browse files

Merge branch 'SETRA-114' into 'master'

Setra-114: Sotra detail model changes: Make product_specification field optional

See merge request !25
parents 9df79cfd 9120590a
No related branches found
No related tags found
1 merge request!25Setra-114: Sotra detail model changes: Make product_specification field optional
Pipeline #97347 passed
......@@ -234,7 +234,7 @@ class Detail(BaseModel):
anlegg: Optional[str]
aktivitet: Optional[str]
line_no: int
product_specification: int
product_specification: Optional[int]
price: Optional[float]
quantity: Optional[float]
......
......@@ -33,7 +33,7 @@
"anlegg": "anlegg",
"aktivitet": "aktivitet",
"line_no": 1,
"product_specification": 213,
"product_specification": null,
"price": "1234.00",
"quantity": 2.0
}
......
......@@ -32,7 +32,7 @@
"anlegg": "anlegg",
"aktivitet": "aktivitet",
"line_no": 1,
"product_specification": 213,
"product_specification": null,
"price": 1234.0,
"quantity": 2.0
},
......
......@@ -513,6 +513,7 @@ def test_get_order_details_list(client, requests_mock, baseurl, detail_list_fixt
response = client.get_details_in_order(order_id="1")
assert isinstance(response, list)
assert len(response) == 2
assert response[1].product_specification is None
def test_send_in_abworder(client, requests_mock, baseurl, complete_abw_order_fixture):
......
......@@ -96,6 +96,13 @@ def test_detail(detail_fixture):
assert Detail(**detail_fixture)
def test_detail_list(detail_list_fixture):
details = [Detail(**i) for i in detail_list_fixture]
assert details
assert details[1].line_total == 123.00
assert details[1].product_specification is None
def test_order_with_detail(order_with_detail_fixture):
order = Order(**order_with_detail_fixture)
assert len(order.details) == 2
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment