Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix tests after rebase

Pacu27321e48f6c21
diff --git a/saleor/schema/email.py b/saleor/schema/email.py
index dde53d6cee..8871d9e266 100644
--- a/saleor/schema/email.py
+++ b/saleor/schema/email.py
@@ -59,7 +59,7 @@ def get_order_confirmation_markup(order):
'orderStatus': 'http://schema.org/OrderProcessing',
'orderDate': order.created}
- for line in order.get_lines():
+ for line in order.lines.all():
product_data = get_product_data(line=line, organization=organization)
data['acceptedOffer'].append(product_data)
return json.dumps(data, cls=DjangoJSONEncoder)
diff --git a/tests/test_order.py b/tests/test_order.py
index 94e9e55aea..d91f57ccd8 100644
--- a/tests/test_order.py
+++ b/tests/test_order.py
@@ -1,15 +1,10 @@
from decimal import Decimal
-<<<<<<< HEAD
-from unittest.mock import Mock
-=======
->>>>>>> Move emails test from test_order to test_emails
from django.urls import reverse
from prices import Money, TaxedMoney
from tests.utils import get_redirect_location
from saleor.order import FulfillmentStatus, models, OrderStatus
-from saleor.order.emails import collect_data_for_email
from saleor.order.forms import OrderNoteForm
from saleor.order.utils import (
add_variant_to_order, cancel_fulfillment, cancel_order, recalculate_order,
@@ -253,30 +248,3 @@ def test_update_order_status(fulfilled_order):
update_order_status(fulfilled_order)
assert fulfilled_order.status == OrderStatus.UNFULFILLED
-
-
-def test_delivery_group_is_shipping_required(delivery_group):
- assert delivery_group.is_shipping_required()
-
-
-def test_delivery_group_is_shipping_required_no_shipping(delivery_group):
- line = delivery_group.lines.first()
- line.is_shipping_required = False
- line.save()
- assert not delivery_group.is_shipping_required()
-
-
-def test_delivery_group_is_shipping_required_partially_required(
- delivery_group, product_without_shipping):
- variant = product_without_shipping.variants.get()
- product_type = product_without_shipping.product_type
- delivery_group.lines.create(
- delivery_group=delivery_group,
- product=product_without_shipping,
- product_name=product_without_shipping.name,
- product_sku=variant.sku,
- is_shipping_required=product_type.is_shipping_required,
- quantity=3,
- unit_price_net=Decimal('30.00'),
- unit_price_gross=Decimal('30.00'))
- assert delivery_group.is_shipping_required()
diff --git a/tests/test_schema.py b/tests/test_schema.py
index 0366ea90ab..b06de37bf1 100644
--- a/tests/test_schema.py
+++ b/tests/test_schema.py
@@ -18,14 +18,14 @@ def test_get_organization(site_settings):
def test_get_product_data_without_image(order_with_lines):
"""Tested OrderLine Product has no image assigned."""
- order_line = order_with_lines.get_lines()[0]
+ order_line = order_with_lines.lines.first()
organization = get_organization()
result = get_product_data(order_line, organization)
assert 'image' not in result['itemOffered']
-def test_get_product_data_with_image(delivery_group, product_with_image):
- order_line = delivery_group.order.get_lines()[0]
+def test_get_product_data_with_image(order_with_lines, product_with_image):
+ order_line = order_with_lines.lines.first()
order_line.product = product_with_image
order_line.product_name = product_with_image.name
order_line.save()