Skip to content

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

Add changelog

fowczrek59b685c886e3
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ff1e96adc0..6de27e0054 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -81,6 +81,7 @@ All notable, unreleased changes to this project will be documented in this file.
- Require non-empty message in orderAddNote mutation - #5316 by @maarcingebala
- Stock management refactor - #5323 by @IKarbowiak
- Add discount error codes - #5348 by @IKarbowiak
+- Add benchmarks to checkout mutations - #5339 by @fowczarek
## 2.9.0
diff --git a/tests/api/benchmark/test_order.py b/tests/api/benchmark/test_order.py
index afa87ca59c..a226fc823c 100644
--- a/tests/api/benchmark/test_order.py
+++ b/tests/api/benchmark/test_order.py
@@ -1,78 +1,12 @@
import pytest
-from tests.api.utils import get_graphql_content
-
-
[email protected]_queries(autouse=False)
-def test_user_order_details(user_api_client, order_with_lines, count_queries):
- query = """
- fragment OrderPrice on TaxedMoney {
- gross {
- amount
- currency
- }
- net {
- amount
- currency
- }
- }
-
- fragment Address on Address {
- id
- firstName
- lastName
- companyName
- streetAddress1
- streetAddress2
- city
- postalCode
- country {
- code
- country
- }
- countryArea
- phone
- isDefaultBillingAddress
- isDefaultShippingAddress
- }
-
- fragment Price on TaxedMoney {
- gross {
- amount
- currency
- }
- net {
- amount
- currency
- }
- }
-
- fragment ProductVariant on ProductVariant {
- id
- name
- pricing {
- onSale
- priceUndiscounted {
- ...Price
- }
- price {
- ...Price
- }
- }
- product {
- id
- name
- thumbnail {
- url
- alt
- }
- thumbnail2x: thumbnail(size: 510) {
- url
- }
- }
- }
+from ..utils import get_graphql_content
+from .test_checkout_mutations import FRAGMENT_ADDRESS, FRAGMENT_PRODUCT_VARIANT
+FRAGMENT_ORDER_DETAILS = (
+ FRAGMENT_ADDRESS
+ + FRAGMENT_PRODUCT_VARIANT
+ + """
fragment OrderDetail on Order {
userEmail
paymentStatus
@@ -92,26 +26,36 @@ def test_user_order_details(user_api_client, order_with_lines, count_queries):
}
unitPrice {
currency
- ...OrderPrice
+ ...Price
}
}
subtotal {
- ...OrderPrice
+ ...Price
}
total {
- ...OrderPrice
+ ...Price
}
shippingPrice {
- ...OrderPrice
- }
- }
-
- query OrderByToken($token: UUID!) {
- orderByToken(token: $token) {
- ...OrderDetail
+ ...Price
}
}
"""
+)
+
+
[email protected]_queries(autouse=False)
+def test_user_order_details(user_api_client, order_with_lines, count_queries):
+ query = (
+ FRAGMENT_ORDER_DETAILS
+ + """
+ query OrderByToken($token: UUID!) {
+ orderByToken(token: $token) {
+ ...OrderDetail
+ }
+ }
+ """
+ )
variables = {
"token": order_with_lines.token,
}