Skip to content

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

Add missing images, docstring and update test for emails

IKarbowiak711f20144793
diff --git a/saleor/core/emails.py b/saleor/core/emails.py
index 17c87f0ade..4b04bb560a 100644
--- a/saleor/core/emails.py
+++ b/saleor/core/emails.py
@@ -19,6 +19,7 @@ def get_email_context():
def prepare_url(params: str, redirect_url: str) -> str:
+ """Add params to redirect url."""
split_url = urlsplit(redirect_url)
split_url = split_url._replace(query=params)
return split_url.geturl()
diff --git a/saleor/static/images/logo-light.svg b/saleor/static/images/logo-light.svg
new file mode 100644
index 0000000000..e67abeecf0
--- /dev/null
+++ b/saleor/static/images/logo-light.svg
@@ -0,0 +1 @@
+<svg enable-background="new 20 0 57.6 19.5" viewBox="0 0 57.6 19.5" xmlns="http://www.w3.org/2000/svg"><path d="m15.5 3.1h-15.5l3.1-3.1h15.5z" fill="#54baba"/><g fill="#222046"><path d="m8.9 19.5c3.8 0 4.8-1.5 4.8-3.6 0-2.6-2.3-3.1-4.3-3.4-1.5-.3-2.2-.4-2.2-1.3 0-.7.6-.9 1.5-.9 1.2 0 1.5.3 1.6 1.3l3.1-.5c-.1-2.1-1.3-3.2-4.5-3.2-3.5 0-4.7 1.4-4.7 3.6 0 2.9 2.7 3.2 4.7 3.5 1.2.2 1.7.4 1.7 1.3 0 .7-.4 1-1.7 1-1.4 0-1.8-.2-2-1.3l-3 .4c.4 2.2 1.7 3.1 5 3.1z"/><path d="m17.5 19.5c1.7 0 2.5-.5 3-1.3v1.2h3.1v-7.6c0-2.5-1-3.8-4.4-3.8-3.3 0-4.4.9-4.9 3.2l3.1.5c.2-1 .5-1.3 1.7-1.3s1.4.5 1.4 1.3v.8h-1.4c-3.9 0-5.2 1.2-5.2 3.6 0 2.2 1.2 3.4 3.6 3.4zm1.4-2.3c-1.5 0-2-.3-2-1.4 0-.9.5-1.3 2.1-1.3h1.6v1.1c0 1-.5 1.6-1.7 1.6z"/><path d="m24.4 19.3h3.1v-16.2l-3.1 3.1z"/><path d="m33.2 19.5c3.6 0 4.6-1.7 4.8-3.4l-3-.4c-.1 1-.3 1.5-1.8 1.5s-1.8-.7-1.8-1.7v-.9h6.6v-2c0-2.8-1.1-4.7-4.8-4.7-3.6 0-4.9 1.9-4.9 4.3v3c0 2.3 1.3 4.3 4.9 4.3zm-1.8-7v-.6c0-1 .5-1.7 1.8-1.7s1.8.6 1.8 1.7v.6z"/><path d="m43.8 7.9c-3.6 0-5 1.8-5 4.3v3c0 2.5 1.4 4.3 5 4.3s5.1-1.8 5.1-4.3v-3c0-2.5-1.5-4.3-5.1-4.3zm2 7.4c0 1.1-.7 1.7-1.9 1.7s-1.9-.7-1.9-1.7v-3.2c0-1.1.6-1.7 1.9-1.7s1.9.7 1.9 1.7z"/><path d="m52.8 8-3.1 3.1v8.2h3.1v-8.2h1.7l3.1-3.1z"/></g></svg>
diff --git a/saleor/static/images/placeholder1080x1080.png b/saleor/static/images/placeholder1080x1080.png
new file mode 100644
index 0000000000..8fd6bf6078
Binary files /dev/null and b/saleor/static/images/placeholder1080x1080.png differ
diff --git a/saleor/static/images/placeholder120x120.png b/saleor/static/images/placeholder120x120.png
new file mode 100644
index 0000000000..9be8593dbd
Binary files /dev/null and b/saleor/static/images/placeholder120x120.png differ
diff --git a/saleor/static/images/placeholder255x255.png b/saleor/static/images/placeholder255x255.png
new file mode 100644
index 0000000000..90451c5134
Binary files /dev/null and b/saleor/static/images/placeholder255x255.png differ
diff --git a/saleor/static/images/placeholder540x540.png b/saleor/static/images/placeholder540x540.png
new file mode 100644
index 0000000000..409d9bee0c
Binary files /dev/null and b/saleor/static/images/placeholder540x540.png differ
diff --git a/saleor/static/images/placeholder60x60.png b/saleor/static/images/placeholder60x60.png
new file mode 100644
index 0000000000..a2efcc0bf8
Binary files /dev/null and b/saleor/static/images/placeholder60x60.png differ
diff --git a/tests/test_emails.py b/tests/test_emails.py
index 7a433a1649..83dc2af211 100644
--- a/tests/test_emails.py
+++ b/tests/test_emails.py
@@ -96,9 +96,10 @@ def test_send_staff_emails_without_notification_recipient(
def test_send_staff_emails(
mocked_templated_email, order, site_settings, staff_notification_recipient
):
- emails.send_staff_order_confirmation(order.pk, "http://www.example.com/")
+ redirect_url = "http://www.example.com/"
+ emails.send_staff_order_confirmation(order.pk, redirect_url)
email_data = emails.collect_staff_order_notification_data(
- order.pk, emails.STAFF_CONFIRM_ORDER_TEMPLATE
+ order.pk, emails.STAFF_CONFIRM_ORDER_TEMPLATE, redirect_url
)
recipients = [staff_notification_recipient.get_email()]
@@ -118,13 +119,6 @@ def test_send_staff_emails(
email_connection.get_email_message(to=recipients, **expected_call_kwargs)
- "send_email,template",
- [
- (emails.send_payment_confirmation, emails.CONFIRM_PAYMENT_TEMPLATE),
- (emails.send_order_confirmation, emails.CONFIRM_ORDER_TEMPLATE),
- ],
-)
@mock.patch("saleor.order.emails.send_templated_mail")
def test_send_email_order_confirmation(mocked_templated_email, order, site_settings):
template = emails.CONFIRM_ORDER_TEMPLATE