Skip to content

Commit

Permalink
Update code after code review
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszgrzyb committed Sep 1, 2021
1 parent b521693 commit 0929193
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions saleor/graphql/payment/mutations.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,7 @@ def perform_mutation(cls, _root, info, checkout_id=None, token=None, **data):
customer_ip_address=get_client_ip(info.context),
checkout=checkout,
return_url=data.get("return_url"),
store_payment_method=data.get("store_payment_method")
or StorePaymentMethod.NONE,
store_payment_method=data["store_payment_method"],
metadata=metadata,
)
return CheckoutPaymentCreate(payment=payment, checkout=checkout)
Expand Down
3 changes: 1 addition & 2 deletions saleor/graphql/payment/tests/test_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,6 @@ def test_create_payment_for_checkout_with_active_payments(
@pytest.mark.parametrize(
"store",
[
None,
StorePaymentMethodEnum.NONE,
StorePaymentMethodEnum.ON_SESSION,
StorePaymentMethodEnum.OFF_SESSION,
Expand Down Expand Up @@ -482,7 +481,7 @@ def test_create_payment_with_store(
# then
checkout.refresh_from_db()
payment = checkout.payments.first()
assert payment.store == (store or StorePaymentMethodEnum.NONE).lower()
assert payment.store == store.lower()


@pytest.mark.parametrize(
Expand Down

0 comments on commit 0929193

Please sign in to comment.