Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Improve `test_get_default_fulfillment_payload` (#19867)
Mikailadb813e632ad
diff --git a/saleor/order/tests/test_notifications.py b/saleor/order/tests/test_notifications.pyindex 65cce5f432..303394f6e0 100644--- a/saleor/order/tests/test_notifications.py+++ b/saleor/order/tests/test_notifications.py@@ -313,15 +313,13 @@ def test_get_default_fulfillment_payload(fulfillment, site_settings):payload["physical_lines"], key=lambda line: line["id"])order_payload["lines"] = sorted(order_payload["lines"], key=lambda line: line["id"])-- assert "physical_lines" in payload- physical_lines = payload["physical_lines"]- for line in fulfillment.lines.all():- assert (- get_default_fulfillment_line_payload(line, attribute_data) in physical_lines- )-- del payload["physical_lines"]+ expected_physical_lines = sorted(+ [+ get_default_fulfillment_line_payload(line, attribute_data)+ for line in fulfillment.lines.all()+ ],+ key=lambda line: line["id"],+ )assert payload == {"order": order_payload,@@ -329,6 +327,7 @@ def test_get_default_fulfillment_payload(fulfillment, site_settings):"tracking_number": fulfillment.tracking_number,"is_tracking_number_url": fulfillment.is_tracking_number_url,},+ "physical_lines": expected_physical_lines,"recipient_email": order.get_customer_email(),**get_site_context_payload(site_settings.site),}