Skip to content
Permalink
Browse files

Merge pull request #4730 from mirumee/account_address_create_fix

Account address create mutation doesn't return user data.
  • Loading branch information...
maarcingebala committed Sep 10, 2019
2 parents fef6eef + ffd841f commit 2a6f85bacbb420ef53a4e05b3f88ca948d910436
Showing with 14 additions and 2 deletions.
  1. +2 −2 saleor/graphql/account/mutations/account.py
  2. +12 −0 tests/api/test_account.py
@@ -174,11 +174,11 @@ def check_permissions(cls, user):
def perform_mutation(cls, root, info, **data):
success_response = super().perform_mutation(root, info, **data)
address_type = data.get("type", None)
user = info.context.user
success_response.user = user
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
@@ -2312,6 +2312,9 @@ def test_account_reset_password_subdomain(
id,
city
}
user {
email
}
}
}
"""
@@ -2341,6 +2344,15 @@ def test_customer_create_address(
assert user.addresses.count() == nr_of_addresses + 1


def test_account_address_create_return_user(user_api_client, graphql_address_data):
user = user_api_client.user
variables = {"addressInput": graphql_address_data}
response = user_api_client.post_graphql(ACCOUNT_ADDRESS_CREATE_MUTATION, variables)
content = get_graphql_content(response)
data = content["data"]["accountAddressCreate"]["user"]
assert data["email"] == user.email


@pytest.mark.parametrize(
"query, mutation_name",
[

0 comments on commit 2a6f85b

Please sign in to comment.
You can’t perform that action at this time.