Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Rearage tests
Michał Sipa8620974c0c34
diff --git a/tests/api/test_account.py b/tests/api/test_account.pyindex 1e9091d37d..0534097daa 100644--- a/tests/api/test_account.py+++ b/tests/api/test_account.py@@ -2780,54 +2780,6 @@ QUERY_CUSTOMERS_WITH_SORT = """"""- "customer_filter, count",- [- ({"search": "example.com"}, 2),- ({"search": "Alice"}, 1),- ({"search": "Kowalski"}, 1),- ({"search": "John"}, 1), # default_shipping_address__first_name- ({"search": "Doe"}, 1), # default_shipping_address__last_name- ({"search": "wroc"}, 1), # default_shipping_address__city- ({"search": "pl"}, 2), # default_shipping_address__country, email- ],-)-def test_query_customer_members_with_filter_search(- customer_filter,- count,- query_customer_with_filter,- staff_api_client,- permission_manage_users,- address,- staff_user,-):-- User.objects.bulk_create(- [- User(- email="[email protected]",- first_name="Alice",- last_name="Kowalski",- is_active=False,- ),- User(- email="[email protected]",- is_active=True,- default_shipping_address=address,- ),- ]- )-- variables = {"filter": customer_filter}- response = staff_api_client.post_graphql(- query_customer_with_filter, variables, permissions=[permission_manage_users]- )- content = get_graphql_content(response)- users = content["data"]["customers"]["edges"]-- assert len(users) == count--@pytest.mark.parametrize("customer_sort, result_order",[@@ -2880,6 +2832,54 @@ def test_query_customers_with_sort(assert users[order]["node"]["firstName"] == user_first_name+ "customer_filter, count",+ [+ ({"search": "example.com"}, 2),+ ({"search": "Alice"}, 1),+ ({"search": "Kowalski"}, 1),+ ({"search": "John"}, 1), # default_shipping_address__first_name+ ({"search": "Doe"}, 1), # default_shipping_address__last_name+ ({"search": "wroc"}, 1), # default_shipping_address__city+ ({"search": "pl"}, 2), # default_shipping_address__country, email+ ],+)+def test_query_customer_members_with_filter_search(+ customer_filter,+ count,+ query_customer_with_filter,+ staff_api_client,+ permission_manage_users,+ address,+ staff_user,+):++ User.objects.bulk_create(+ [+ User(+ email="[email protected]",+ first_name="Alice",+ last_name="Kowalski",+ is_active=False,+ ),+ User(+ email="[email protected]",+ is_active=True,+ default_shipping_address=address,+ ),+ ]+ )++ variables = {"filter": customer_filter}+ response = staff_api_client.post_graphql(+ query_customer_with_filter, variables, permissions=[permission_manage_users]+ )+ content = get_graphql_content(response)+ users = content["data"]["customers"]["edges"]++ assert len(users) == count++@pytest.mark.parametrize("staff_member_filter, count",[({"status": "DEACTIVATED"}, 1), ({"status": "ACTIVE"}, 2)],diff --git a/tests/api/test_order.py b/tests/api/test_order.pyindex 3a7c5dd485..c6545e2142 100644--- a/tests/api/test_order.py+++ b/tests/api/test_order.py@@ -2311,7 +2311,7 @@ def test_draft_order_query_with_filter_customer_fields(({"created": {"gte": str(date.today() + timedelta(days=1))}}, 0),],)-def test_draft_order_query_with_filter_created(+def test_draft_order_query_with_filter_created_(orders_filter,count,draft_orders_query_with_filter,