Skip to content

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

Remove deprecated account and staff mutations

IKarbowiak0f6968b7a802
diff --git a/saleor/graphql/account/mutations/deprecated_account.py b/saleor/graphql/account/mutations/deprecated_account.py
deleted file mode 100644
index 0e5dd2854b..0000000000
--- a/saleor/graphql/account/mutations/deprecated_account.py
+++ /dev/null
@@ -1,195 +0,0 @@
-import graphene
-from django.core.exceptions import ObjectDoesNotExist, ValidationError
-
-from ....account import events as account_events, models, utils
-from ....account.error_codes import AccountErrorCode
-from ....checkout import AddressType
-from ...account.enums import AddressTypeEnum
-from ...account.types import Address, AddressInput, User
-from ...core.mutations import BaseMutation, ModelMutation
-from .base import BaseCustomerCreate, UserAddressInput
-from .deprecated_staff import send_user_password_reset_email
-
-
-class CustomerRegisterInput(graphene.InputObjectType):
- email = graphene.String(
- description="The unique email address of the user.", required=True
- )
- password = graphene.String(description="Password.", required=True)
-
-
-class CustomerRegister(ModelMutation):
- class Arguments:
- input = CustomerRegisterInput(
- description="Fields required to create a user.", required=True
- )
-
- class Meta:
- description = (
- "DEPRECATED: Will be removed in Saleor 2.10, "
- "use AccountRegister instead. Register a new user."
- )
- exclude = ["password"]
- model = models.User
-
- @classmethod
- def save(cls, info, user, cleaned_input):
- password = cleaned_input["password"]
- user.set_password(password)
- user.save()
- account_events.customer_account_created_event(user=user)
- info.context.extensions.customer_created(customer=user)
-
-
-class LoggedUserUpdate(BaseCustomerCreate):
- class Arguments:
- input = UserAddressInput(
- description="Fields required to update a logged in user.", required=True
- )
-
- class Meta:
- description = (
- "DEPRECATED: Will be removed in Saleor 2.10, use AccountUpdate instead."
- "Updates data of the logged in user."
- )
- exclude = ["password"]
- model = models.User
-
- @classmethod
- def check_permissions(cls, context):
- return context.user.is_authenticated
-
- @classmethod
- def perform_mutation(cls, root, info, **data):
- user = info.context.user
- data["id"] = graphene.Node.to_global_id("User", user.id)
- return super().perform_mutation(root, info, **data)
-
-
-class CustomerAddressCreate(ModelMutation):
- user = graphene.Field(
- User, description="A user instance for which the address was created."
- )
-
- class Arguments:
- input = AddressInput(
- description="Fields required to create address.", required=True
- )
- type = AddressTypeEnum(
- required=False,
- description=(
- "A type of address. If provided, the new address will be "
- "automatically assigned as the customer's default address "
- "of that type."
- ),
- )
-
- class Meta:
- description = (
- "DEPRECATED: Will be removed in Saleor 2.10, use AccountAddressCreate "
- "instead. Create a new address for the customer."
- )
- model = models.Address
- exclude = ["user_addresses"]
-
- @classmethod
- def check_permissions(cls, context):
- return context.user.is_authenticated
-
- @classmethod
- def perform_mutation(cls, root, info, **data):
- success_response = super().perform_mutation(root, info, **data)
- address_type = data.get("type", None)
- if address_type:
- user = info.context.user
- instance = success_response.address
- utils.change_user_default_address(user, instance, address_type)
- success_response.user = user
- return success_response
-
- @classmethod
- def save(cls, info, instance, cleaned_input):
- super().save(info, instance, cleaned_input)
- user = info.context.user
- instance.user_addresses.add(user)
-
-
-class CustomerSetDefaultAddress(BaseMutation):
- user = graphene.Field(User, description="An updated user instance.")
-
- class Arguments:
- id = graphene.ID(
- required=True, description="ID of the address to set as default."
- )
- type = AddressTypeEnum(required=True, description="The type of address.")
-
- class Meta:
- description = (
- "DEPRECATED: Will be removed in Saleor 2.10, use AccountSetDefaultAddress "
- "instead. Sets a default address for the authenticated user."
- )
-
- @classmethod
- def check_permissions(cls, context):
- return context.user.is_authenticated
-
- @classmethod
- def perform_mutation(cls, _root, info, **data):
- address = cls.get_node_or_error(info, data.get("id"), Address)
- user = info.context.user
-
- if address not in user.addresses.all():
- raise ValidationError(
- {
- "id": ValidationError(
- "The address doesn't belong to that user.",
- code=AccountErrorCode.INVALID,
- )
- }
- )
-
- if data.get("type") == AddressTypeEnum.BILLING.value:
- address_type = AddressType.BILLING
- else:
- address_type = AddressType.SHIPPING
-
- utils.change_user_default_address(user, address, address_type)
- return cls(user=user)
-
-
-class CustomerPasswordResetInput(graphene.InputObjectType):
- email = graphene.String(
- required=True,
- description=("Email of the user that will be used for password recovery."),
- )
-
-
-class CustomerPasswordReset(BaseMutation):
- class Arguments:
- input = CustomerPasswordResetInput(
- description="Fields required to reset customer's password.", required=True
- )
-
- class Meta:
- description = (
- "DEPRECATED: Will be removed in Saleor 2.10, use RequestPasswordReset "
- "instead. Resets the customer's password."
- )
-
- @classmethod
- def perform_mutation(cls, _root, info, **data):
- email = data.get("input")["email"]
- try:
- user = models.User.objects.get(email=email)
- except ObjectDoesNotExist:
- raise ValidationError(
- {
- "email": ValidationError(
- "User with this email doesn't exist",
- code=AccountErrorCode.NOT_FOUND,
- )
- }
- )
- site = info.context.site
- send_user_password_reset_email(user, site)
- return CustomerPasswordReset()
diff --git a/saleor/graphql/account/mutations/deprecated_staff.py b/saleor/graphql/account/mutations/deprecated_staff.py
deleted file mode 100644
index 67796d298e..0000000000
--- a/saleor/graphql/account/mutations/deprecated_staff.py
+++ /dev/null
@@ -1,51 +0,0 @@
-import graphene
-from django.conf import settings
-from django.contrib.auth.tokens import default_token_generator
-from django.core.exceptions import ObjectDoesNotExist, ValidationError
-from django.utils.encoding import force_bytes
-from django.utils.http import urlsafe_base64_encode
-
-from ....account import emails, models
-from ....account.error_codes import AccountErrorCode
-from ...core.mutations import BaseMutation
-
-
-def send_user_password_reset_email(user, site):
- context = {
- "email": user.email,
- "uid": urlsafe_base64_encode(force_bytes(user.pk)),
- "token": default_token_generator.make_token(user),
- "site_name": site.name,
- "domain": site.domain,
- "protocol": "https" if settings.ENABLE_SSL else "http",
- }
- emails.send_user_password_reset_email(user.email, context, user.pk)
-
-
-class PasswordReset(BaseMutation):
- class Arguments:
- email = graphene.String(description="Email.", required=True)
-
- class Meta:
- description = (
- "DEPRECATED: Will be removed in Saleor 2.10, use RequestPasswordReset "
- "instead. Sends an email with the account password change link to customer."
- )
- permissions = ("account.manage_users",)
-
- @classmethod
- def perform_mutation(cls, _root, info, email):
- try:
- user = models.User.objects.get(email=email)
- except ObjectDoesNotExist:
- raise ValidationError(
- {
- "email": ValidationError(
- "User with this email doesn't exist",
- code=AccountErrorCode.NOT_FOUND,
- )
- }
- )
- site = info.context.site
- send_user_password_reset_email(user, site)
- return PasswordReset()
diff --git a/saleor/graphql/account/schema.py b/saleor/graphql/account/schema.py
index de7bb36daa..b65068f743 100644
--- a/saleor/graphql/account/schema.py
+++ b/saleor/graphql/account/schema.py
@@ -26,14 +26,6 @@ from .mutations.base import (
UserClearMeta,
UserUpdateMeta,
)
-from .mutations.deprecated_account import (
- CustomerAddressCreate,
- CustomerPasswordReset,
- CustomerRegister,
- CustomerSetDefaultAddress,
- LoggedUserUpdate,
-)
-from .mutations.deprecated_staff import PasswordReset
from .mutations.service_account import (
ServiceAccountClearPrivateMeta,
ServiceAccountCreate,
@@ -190,15 +182,6 @@ class AccountMutations(graphene.ObjectType):
account_update_meta = AccountUpdateMeta.Field()
- # Account deprecated mutations
- customer_password_reset = CustomerPasswordReset.Field()
-
- customer_address_create = CustomerAddressCreate.Field()
- customer_set_default_address = CustomerSetDefaultAddress.Field()
-
- customer_register = CustomerRegister.Field()
- logged_user_update = LoggedUserUpdate.Field()
-
# Staff mutation
address_create = AddressCreate.Field()
address_update = AddressUpdate.Field()
@@ -234,6 +217,3 @@ class AccountMutations(graphene.ObjectType):
service_account_token_create = ServiceAccountTokenCreate.Field()
service_account_token_delete = ServiceAccountTokenDelete.Field()
-
- # Staff deprecated mutation
- password_reset = PasswordReset.Field()
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index 26f6aa6645..dc939255a0 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -1287,12 +1287,6 @@ type CreditCard {
expYear: Int!
}
-type CustomerAddressCreate {
- errors: [Error!]
- user: User
- address: Address
-}
-
type CustomerBulkDelete {
errors: [Error!]
count: Int!
@@ -1353,29 +1347,6 @@ input CustomerInput {
note: String
}
-type CustomerPasswordReset {
- errors: [Error!]
-}
-
-input CustomerPasswordResetInput {
- email: String!
-}
-
-type CustomerRegister {
- errors: [Error!]
- user: User
-}
-
-input CustomerRegisterInput {
- email: String!
- password: String!
-}
-
-type CustomerSetDefaultAddress {
- errors: [Error!]
- user: User
-}
-
type CustomerUpdate {
errors: [Error!]
accountErrors: [AccountError!]
@@ -1836,11 +1807,6 @@ type LanguageDisplay {
language: String!
}
-type LoggedUserUpdate {
- errors: [Error!]
- user: User
-}
-
type Margin {
start: Int
stop: Int
@@ -2267,11 +2233,6 @@ type Mutation {
accountRequestDeletion(redirectUrl: String!): AccountRequestDeletion
accountDelete(token: String!): AccountDelete
accountUpdateMeta(input: MetaInput!): AccountUpdateMeta
- customerPasswordReset(input: CustomerPasswordResetInput!): CustomerPasswordReset
- customerAddressCreate(input: AddressInput!, type: AddressTypeEnum): CustomerAddressCreate
- customerSetDefaultAddress(id: ID!, type: AddressTypeEnum!): CustomerSetDefaultAddress
- customerRegister(input: CustomerRegisterInput!): CustomerRegister
- loggedUserUpdate(input: UserAddressInput!): LoggedUserUpdate
addressCreate(input: AddressInput!, userId: ID!): AddressCreate
addressUpdate(id: ID!, input: AddressInput!): AddressUpdate
addressDelete(id: ID!): AddressDelete
@@ -2298,7 +2259,6 @@ type Mutation {
serviceAccountClearPrivateMetadata(id: ID!, input: MetaPath!): ServiceAccountClearPrivateMeta
serviceAccountTokenCreate(input: ServiceAccountTokenInput!): ServiceAccountTokenCreate
serviceAccountTokenDelete(id: ID!): ServiceAccountTokenDelete
- passwordReset(email: String!): PasswordReset
}
input NameTranslationInput {
@@ -2741,10 +2701,6 @@ type PasswordChange {
accountErrors: [AccountError!]
}
-type PasswordReset {
- errors: [Error!]
-}
-
type Payment implements Node {
id: ID!
gateway: String!
@@ -4172,11 +4128,6 @@ type User implements Node {
storedPaymentSources: [PaymentSource]
}
-input UserAddressInput {
- defaultBillingAddress: AddressInput
- defaultShippingAddress: AddressInput
-}
-
type UserAvatarDelete {
errors: [Error!]
user: User
diff --git a/tests/api/test_account.py b/tests/api/test_account.py
index 789d88b7e3..6ea7730eaf 100644
--- a/tests/api/test_account.py
+++ b/tests/api/test_account.py
@@ -569,21 +569,6 @@ def test_user_with_cancelled_fulfillments(
assert fulfillments[1]["status"] == FulfillmentStatus.CANCELED.upper()
-CUSTOMER_REGISTER_MUTATION = """
- mutation RegisterCustomer($password: String!, $email: String!) {
- customerRegister(input: {password: $password, email: $email}) {
- errors {
- field
- message
- }
- user {
- id
- }
- }
- }
-"""
-
-
ACCOUNT_REGISTER_MUTATION = """
mutation RegisterAccount($password: String!, $email: String!) {
accountRegister(input: {password: $password, email: $email}) {
@@ -599,16 +584,11 @@ ACCOUNT_REGISTER_MUTATION = """
"""
- "query, mutation_name",
- [
- (CUSTOMER_REGISTER_MUTATION, "customerRegister"),
- (ACCOUNT_REGISTER_MUTATION, "accountRegister"),
- ],
-)
-def test_customer_register(user_api_client, query, mutation_name):
+def test_customer_register(user_api_client):
variables = {"email": email, "password": "Password"}
+ query = ACCOUNT_REGISTER_MUTATION
+ mutation_name = "accountRegister"
response = user_api_client.post_graphql(query, variables)
content = get_graphql_content(response)
data = content["data"][mutation_name]
@@ -1038,42 +1018,7 @@ def test_logged_customer_update_names(user_api_client):
assert user.last_name == last_name
-UPDATE_LOGGED_CUSTOMER_QUERY = """
- mutation UpdateLoggedCustomer($billing: AddressInput,
- $shipping: AddressInput) {
- loggedUserUpdate(
- input: {
- defaultBillingAddress: $billing,
- defaultShippingAddress: $shipping,
- }) {
- errors {
- field
- message
- }
- user {
- email
- defaultBillingAddress {
- id
- }
- defaultShippingAddress {
- id
- }
- }
- }
- }
-"""
-
-
- "query, mutation_name",
- [
- (UPDATE_LOGGED_CUSTOMER_QUERY, "loggedUserUpdate"),
- (ACCOUNT_UPDATE_QUERY, "accountUpdate"),
- ],
-)
-def test_logged_customer_update_addresses(
- user_api_client, graphql_address_data, query, mutation_name
-):
+def test_logged_customer_update_addresses(user_api_client, graphql_address_data):
# this test requires addresses to be set and checks whether new address
# instances weren't created, but the existing ones got updated
user = user_api_client.user
@@ -1082,6 +1027,9 @@ def test_logged_customer_update_addresses(
assert user.default_shipping_address
assert user.default_billing_address.first_name != new_first_name
assert user.default_shipping_address.first_name != new_first_name
+
+ query = ACCOUNT_UPDATE_QUERY
+ mutation_name = "accountUpdate"
variables = {"billing": graphql_address_data, "shipping": graphql_address_data}
response = user_api_client.post_graphql(query, variables)
content = get_graphql_content(response)
@@ -1099,10 +1047,8 @@ def test_logged_customer_update_addresses(
assert user.default_shipping_address.first_name == new_first_name
- "query", [(UPDATE_LOGGED_CUSTOMER_QUERY), (ACCOUNT_UPDATE_QUERY)]
-)
-def test_logged_customer_update_anonymous_user(api_client, query):
+def test_logged_customer_update_anonymous_user(api_client):
+ query = ACCOUNT_UPDATE_QUERY
response = api_client.post_graphql(query, {})
assert_no_permission(response)
@@ -1764,61 +1710,6 @@ def test_set_password_invalid_password(user_api_client, customer_user, settings)
assert account_errors[1]["code"] == str_to_enum("password_entirely_numeric")
-@patch("saleor.account.emails._send_user_password_reset_email.delay")
-def test_deprecated_password_reset_email(
- send_password_reset_mock, staff_api_client, customer_user, permission_manage_users
-):
- query = """
- mutation ResetPassword($email: String!) {
- passwordReset(email: $email) {
- errors {
- field
- message
- }
- }
- }
- """
- email = customer_user.email
- variables = {"email": email}
- response = staff_api_client.post_graphql(
- query, variables, permissions=[permission_manage_users]
- )
- content = get_graphql_content(response)
- data = content["data"]["passwordReset"]
- assert data == {"errors": []}
- assert send_password_reset_mock.call_count == 1
- send_password_reset_mock.assert_called_once_with(
- customer_user.email, ANY, customer_user.pk
- )
-
-
-@patch("saleor.account.emails._send_user_password_reset_email.delay")
-def test_password_reset_email_non_existing_user(
- send_password_reset_mock, staff_api_client, permission_manage_users
-):
- query = """
- mutation ResetPassword($email: String!) {
- passwordReset(email: $email) {
- errors {
- field
- message
- }
- }
- }
- """
- email = "[email protected]"
- variables = {"email": email}
- response = staff_api_client.post_graphql(
- query, variables, permissions=[permission_manage_users]
- )
- content = get_graphql_content(response)
- data = content["data"]["passwordReset"]
- assert data["errors"] == [
- {"field": "email", "message": "User with this email doesn't exist"}
- ]
- send_password_reset_mock.assert_not_called()
-
-
CHANGE_PASSWORD_MUTATION = """
mutation PasswordChange($oldPassword: String!, $newPassword: String!) {
passwordChange(oldPassword: $oldPassword, newPassword: $newPassword) {
@@ -2238,35 +2129,6 @@ def test_address_validation_rules_fields_in_camel_case(user_api_client):
assert "streetAddress2" in allowed_fields
-CUSTOMER_PASSWORD_RESET_MUTATION = """
- mutation CustomerPasswordReset($email: String!) {
- customerPasswordReset(input: {email: $email}) {
- errors {
- field
- message
- }
- }
- }
-"""
-
-
-@patch("saleor.account.emails._send_password_reset_email")
-def test_deprecated_account_reset_password(
- send_password_reset_mock, user_api_client, customer_user
-):
- # we have no user with given email
- variables = {"email": "[email protected]"}
- response = user_api_client.post_graphql(CUSTOMER_PASSWORD_RESET_MUTATION, variables)
- get_graphql_content(response)
- assert not send_password_reset_mock.called
-
- variables = {"email": customer_user.email}
- response = user_api_client.post_graphql(CUSTOMER_PASSWORD_RESET_MUTATION, variables)
- get_graphql_content(response)
- assert send_password_reset_mock.called
- assert send_password_reset_mock.mock_calls[0][1][0] == customer_user.email
-
-
REQUEST_PASSWORD_RESET_MUTATION = """
mutation RequestPasswordReset($email: String!, $redirectUrl: String!) {
requestPasswordReset(email: $email, redirectUrl: $redirectUrl) {
@@ -2382,18 +2244,6 @@ def test_account_reset_password_subdomain(
url_validator(url)
-CUSTOMER_ADDRESS_CREATE_MUTATION = """
-mutation($addressInput: AddressInput!, $addressType: AddressTypeEnum) {
- customerAddressCreate(input: $addressInput, type: $addressType) {
- address {
- id,
- city
- }
- }
-}
-"""
-
-
ACCOUNT_ADDRESS_CREATE_MUTATION = """
mutation($addressInput: AddressInput!, $addressType: AddressTypeEnum) {
accountAddressCreate(input: $addressInput, type: $addressType) {
@@ -2409,19 +2259,13 @@ mutation($addressInput: AddressInput!, $addressType: AddressTypeEnum) {
"""
- "query, mutation_name",
- [
- (CUSTOMER_ADDRESS_CREATE_MUTATION, "customerAddressCreate"),
- (ACCOUNT_ADDRESS_CREATE_MUTATION, "accountAddressCreate"),
- ],
-)
-def test_customer_create_address(
- user_api_client, graphql_address_data, query, mutation_name
-):
+def test_customer_create_address(user_api_client, graphql_address_data):
user = user_api_client.user
nr_of_addresses = user.addresses.count()
+ query = ACCOUNT_ADDRESS_CREATE_MUTATION
+ mutation_name = "accountAddressCreate"
+
variables = {"addressInput": graphql_address_data}
response = user_api_client.post_graphql(query, variables)
content = get_graphql_content(response)
@@ -2442,19 +2286,13 @@ def test_account_address_create_return_user(user_api_client, graphql_address_dat
assert data["email"] == user.email
- "query, mutation_name",
- [
- (CUSTOMER_ADDRESS_CREATE_MUTATION, "customerAddressCreate"),
- (ACCOUNT_ADDRESS_CREATE_MUTATION, "accountAddressCreate"),
- ],
-)
-def test_customer_create_default_address(
- user_api_client, graphql_address_data, query, mutation_name
-):
+def test_customer_create_default_address(user_api_client, graphql_address_data):
user = user_api_client.user
nr_of_addresses = user.addresses.count()
+ query = ACCOUNT_ADDRESS_CREATE_MUTATION
+ mutation_name = "accountAddressCreate"
+
address_type = AddressType.SHIPPING.upper()
variables = {"addressInput": graphql_address_data, "addressType": address_type}
response = user_api_client.post_graphql(query, variables)
@@ -2482,27 +2320,13 @@ def test_customer_create_default_address(
)
- "query", [CUSTOMER_ADDRESS_CREATE_MUTATION, ACCOUNT_ADDRESS_CREATE_MUTATION]
-)
-def test_anonymous_user_create_address(api_client, graphql_address_data, query):
+def test_anonymous_user_create_address(api_client, graphql_address_data):
+ query = ACCOUNT_ADDRESS_CREATE_MUTATION
variables = {"addressInput": graphql_address_data}
response = api_client.post_graphql(query, variables)
assert_no_permission(response)
-CUSTOMER_SET_DEFAULT_ADDRESS_MUTATION = """
-mutation($id: ID!, $type: AddressTypeEnum!) {
- customerSetDefaultAddress(id: $id, type: $type) {
- errors {
- field,
- message
- }
- }
-}
-"""
-
-
ACCOUNT_SET_DEFAULT_ADDRESS_MUTATION = """
mutation($id: ID!, $type: AddressTypeEnum!) {
accountSetDefaultAddress(id: $id, type: $type) {
@@ -2515,14 +2339,7 @@ mutation($id: ID!, $type: AddressTypeEnum!) {
"""
- "query, mutation_name",
- [
- (CUSTOMER_SET_DEFAULT_ADDRESS_MUTATION, "customerSetDefaultAddress"),
- (ACCOUNT_SET_DEFAULT_ADDRESS_MUTATION, "accountSetDefaultAddress"),
- ],
-)
-def test_customer_set_address_as_default(user_api_client, query, mutation_name):
+def test_customer_set_address_as_default(user_api_client):
user = user_api_client.user
user.default_billing_address = None
user.default_shipping_address = None
@@ -2532,6 +2349,8 @@ def test_customer_set_address_as_default(user_api_client, query, mutation_name):
assert user.addresses.exists()
address = user.addresses.first()
+ query = ACCOUNT_SET_DEFAULT_ADDRESS_MUTATION
+ mutation_name = "accountSetDefaultAddress"
variables = {
"id": graphene.Node.to_global_id("Address", address.id),
@@ -2555,16 +2374,7 @@ def test_customer_set_address_as_default(user_api_client, query, mutation_name):
assert user.default_billing_address == address
- "query, mutation_name",
- [
- (CUSTOMER_SET_DEFAULT_ADDRESS_MUTATION, "customerSetDefaultAddress"),
- (ACCOUNT_SET_DEFAULT_ADDRESS_MUTATION, "accountSetDefaultAddress"),
- ],
-)
-def test_customer_change_default_address(
- user_api_client, address_other_country, query, mutation_name
-):
+def test_customer_change_default_address(user_api_client, address_other_country):
user = user_api_client.user
assert user.default_billing_address
assert user.default_billing_address
@@ -2577,6 +2387,9 @@ def test_customer_change_default_address(
user.refresh_from_db()
assert address_other_country not in user.addresses.all()
+ query = ACCOUNT_SET_DEFAULT_ADDRESS_MUTATION
+ mutation_name = "accountSetDefaultAddress"
+
variables = {
"id": graphene.Node.to_global_id("Address", address.id),
"type": AddressType.SHIPPING.upper(),
@@ -2591,19 +2404,15 @@ def test_customer_change_default_address(
assert address_other_country in user.addresses.all()
- "query, mutation_name",
- [
- (CUSTOMER_SET_DEFAULT_ADDRESS_MUTATION, "customerSetDefaultAddress"),
- (ACCOUNT_SET_DEFAULT_ADDRESS_MUTATION, "accountSetDefaultAddress"),
- ],
-)
def test_customer_change_default_address_invalid_address(
- user_api_client, address_other_country, query, mutation_name
+ user_api_client, address_other_country
):
user = user_api_client.user
assert address_other_country not in user.addresses.all()
+ query = ACCOUNT_SET_DEFAULT_ADDRESS_MUTATION
+ mutation_name = "accountSetDefaultAddress"
+
variables = {
"id": graphene.Node.to_global_id("Address", address_other_country.id),
"type": AddressType.SHIPPING.upper(),