Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Cleanup tests
Ania Warzechaa073da1408f9
diff --git a/saleor/graphql/order/tests/mutations/test_order_line_delete.py b/saleor/graphql/order/tests/mutations/test_order_line_delete.pyindex 395fefbb75..6e3004dc5b 100644--- a/saleor/graphql/order/tests/mutations/test_order_line_delete.py+++ b/saleor/graphql/order/tests/mutations/test_order_line_delete.py@@ -132,6 +132,7 @@ def test_order_line_remove_no_line_allocations(permission_group_manage_orders,staff_api_client,):+ # givenquery = ORDER_LINE_DELETE_MUTATIONpermission_group_manage_orders.user_set.add(staff_api_client.user)order = order_with_lines@@ -142,7 +143,10 @@ def test_order_line_remove_no_line_allocations(line_id = graphene.Node.to_global_id("OrderLine", line.id)variables = {"id": line_id}+ # whenresponse = staff_api_client.post_graphql(query, variables)++ # thencontent = get_graphql_content(response)data = content["data"]["orderLineDelete"]assert OrderEvent.objects.count() == 1diff --git a/saleor/graphql/order/tests/mutations/test_order_line_update.py b/saleor/graphql/order/tests/mutations/test_order_line_update.pyindex 9cc72ae25d..4367a4c1fc 100644--- a/saleor/graphql/order/tests/mutations/test_order_line_update.py+++ b/saleor/graphql/order/tests/mutations/test_order_line_update.py@@ -255,6 +255,7 @@ def test_order_line_update_no_allocation(staff_api_client,staff_user,):+ # givenquery = ORDER_LINE_UPDATE_MUTATIONorder = order_with_linesorder.status = OrderStatus.UNCONFIRMED@@ -266,22 +267,16 @@ def test_order_line_update_no_allocation(line_id = graphene.Node.to_global_id("OrderLine", line.id)variables = {"lineId": line_id, "quantity": new_quantity}- # Ensure the line has the expected quantity- assert line.quantity == 3-+ # when# No event should exist yetassert not OrderEvent.objects.exists()- # mutation should fail without proper permissions- response = staff_api_client.post_graphql(query, variables)- assert_no_permission(response)- order_updated_webhook_mock.assert_not_called()- draft_order_updated_webhook_mock.assert_not_called()-# assign permissionspermission_group_manage_orders.user_set.add(staff_api_client.user)response = staff_api_client.post_graphql(query, variables)content = get_graphql_content(response)++ # thendata = content["data"]["orderLineUpdate"]assert data["orderLine"]["quantity"] == new_quantityassert_proper_webhook_called_once(@@ -299,14 +294,6 @@ def test_order_line_update_no_allocation(]}- # mutation should fail when quantity is lower than 1- variables = {"lineId": line_id, "quantity": 0}- response = staff_api_client.post_graphql(query, variables)- content = get_graphql_content(response)- data = content["data"]["orderLineUpdate"]- assert data["errors"]- assert data["errors"][0]["field"] == "quantity"-def test_order_line_update_by_user_no_channel_access(order_with_lines,