Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
ADjustments after rebasing with the latests master
Pacu2b649367c9435
diff --git a/Pipfile b/Pipfileindex f254ee1685..9a84234f17 100644--- a/Pipfile+++ b/Pipfile@@ -22,7 +22,7 @@ django-filter = ">=2.0"django-fsm = ">=2.6.0"django-graphql-jwt = ">=0.1.13"django-impersonate = ">=1.3"-django-measurement = "==3.1.1"+django-measurement = "==3.0.0"django-mptt = ">=0.7.1"django-payments = ">=0.12.1"django-phonenumber-field = ">=1.3.0"diff --git a/requirements.in b/requirements.indeleted file mode 100644index d6fa29bc35..0000000000--- a/requirements.in+++ /dev/null@@ -1,114 +0,0 @@-#-# This file is autogenerated by pip-compile-# To update, run:-#-# pip-compile --output-file requirements.txt requirements.txt-#-amqp==2.3.2-aniso8601==3.0.2-asn1crypto==0.24.0-babel==2.6.0-billiard==3.5.0.4-bleach==2.1.4-boto3==1.9.13-botocore==1.12.13-braintree==3.48.0-cairocffi==0.9.0-cairosvg==2.2.1 ; python_version >= "3.0"-celery==4.2.1-certifi==2018.8.24-cffi==1.11.5-chardet==3.0.4-cryptography==2.3.1-cssselect2==0.2.1-defusedxml==0.5.0-dj-database-url==0.5.0-dj-email-url==0.1.0-django-appconf==1.0.2-django-babel==0.6.2-django-bootstrap4==0.0.7-django-cache-url==3.0.0-django-celery-results==1.0.1-django-countries==5.3.2-django-debug-toolbar-request-history==0.0.9-django-debug-toolbar==1.10.1-django-elasticsearch-dsl==0.5.0-django-filter==2.0.0-django-fsm==2.6.0-django-graphql-jwt==0.1.12-django-impersonate==1.3-django-js-asset==1.1.0-django-measurement==3.0.0-django-mptt==0.9.1-django-payments==0.13.0-django-phonenumber-field==2.0.1-django-prices-openexchangerates==1.0.1-django-prices-vatlayer==1.0.2-django-prices==1.0.4-django-recaptcha==1.4.0-django-redis==4.9.0-django-render-block==0.5-django-storages==1.7.1-django-templated-email==2.2.0-django-versatileimagefield==1.10-django-webpack-loader==0.6.0-django==2.1.1-docutils==0.14-elasticsearch-dsl==5.4.0-elasticsearch==5.5.3-faker==0.9.1-freezegun==0.3.10-google-i18n-address==2.3.2-google-measurement-protocol==1.0.0-graphene-django==2.2.0-graphene==2.1.3-graphql-core==2.1-graphql-relay==0.4.5-html5lib==1.0.1-idna==2.7-jmespath==0.9.3-jsonfield==2.0.2-kombu==4.2.1-markdown==3.0.1-maxminddb-geolite2==2018.703-maxminddb==1.4.1-measurement==2.0.1-mpmath==1.0.0-oauthlib==2.1.0-pdfrw==0.4-phonenumbers==8.9.14-phonenumberslite==8.9.14-pillow==5.2.0-prices==1.0.0-promise==2.1-psycopg2-binary==2.7.5-purl==1.4-pycparser==2.19-pyjwt==1.6.4-pyphen==0.9.5-python-dateutil==2.7.3 ; python_version >= "2.7"-python3-openid==3.1.0 ; python_version >= "3.0"-pytz==2018.5-raven==6.9.0-redis==2.10.6-requests-oauthlib==1.0.0-requests==2.19.1-rx==1.6.1-s3transfer==0.1.13-singledispatch==3.4.0.3-six==1.11.0-social-auth-app-django==2.1.0-social-auth-core==1.7.0-sqlparse==0.2.4 # via django-debug-toolbar-stripe==2.10.0-suds-jurko==0.6-sympy==1.3-text-unidecode==1.2-tinycss2==0.6.1-typing==3.6.6-urllib3==1.23-uwsgi==2.0.17.1 ; platform_system != "Windows"-vine==1.1.4-weasyprint==0.42.3-webencodings==0.5.1-xmltodict==0.11.0diff --git a/saleor/checkout/migrations/0011_auto_20180814_0216.py b/saleor/checkout/migrations/0011_auto_20180814_0216.pydeleted file mode 100644index 9d4dcdb558..0000000000--- a/saleor/checkout/migrations/0011_auto_20180814_0216.py+++ /dev/null@@ -1,19 +0,0 @@-# Generated by Django 2.0.3 on 2018-08-14 07:16--import django.contrib.postgres.fields.jsonb-from django.db import migrations---class Migration(migrations.Migration):-- dependencies = [- ('checkout', '0010_auto_20180822_0720'),- ]-- operations = [- migrations.AlterField(- model_name='cartline',- name='data',- field=django.contrib.postgres.fields.jsonb.JSONField(blank=True, default={}),- ),- ]diff --git a/saleor/checkout/migrations/0015_merge_20180928_0658.py b/saleor/checkout/migrations/0015_merge_20180928_0658.pydeleted file mode 100644index 1b64b5ecb4..0000000000--- a/saleor/checkout/migrations/0015_merge_20180928_0658.py+++ /dev/null@@ -1,14 +0,0 @@-# Generated by Django 2.0.8 on 2018-09-28 11:58--from django.db import migrations---class Migration(migrations.Migration):-- dependencies = [- ('checkout', '0014_auto_20180921_0751'),- ('checkout', '0011_auto_20180814_0216'),- ]-- operations = [- ]diff --git a/saleor/graphql/checkout/mutations.py b/saleor/graphql/checkout/mutations.pyindex 36548914eb..0baa1ffc5e 100644--- a/saleor/graphql/checkout/mutations.py+++ b/saleor/graphql/checkout/mutations.py@@ -154,7 +154,7 @@ class CheckoutLinesAdd(BaseMutation):'an item in the checkout.'))class Meta:- description = 'Adds a checkout line to existing checkout.'+ description = 'Adds a checkout line to the existing checkout.'@classmethoddef mutate(cls, root, info, checkout_id, lines, replace=False):@@ -247,7 +247,7 @@ class CheckoutCustomerDetach(BaseMutation):checkout_id = graphene.ID(description='Checkout ID', required=True)class Meta:- description = 'Update shipping address in existing Checkout object'+ description = 'Removes the user assigned as the owner of the checkout.'@classmethoddef mutate(cls, root, info, checkout_id):@@ -370,6 +370,9 @@ class CheckoutShippingMethodUpdate(BaseMutation):shipping_method_id = graphene.ID(required=True, description='Shipping method')+ class Meta:+ description = 'Updates the shipping address of the checkout.'+@classmethoddef mutate(cls, root, info, checkout_id, shipping_method_id):errors = []@@ -396,6 +399,11 @@ class CheckoutComplete(BaseMutation):class Arguments:checkout_id = graphene.ID(description='Checkout ID')+ class Meta:+ description = (+ 'Completes the checkout, creates an order from it and '+ 'charges the customer\'s funding source.')+@classmethoddef mutate(cls, root, info, checkout_id):errors = []diff --git a/saleor/graphql/order/types.py b/saleor/graphql/order/types.pyindex e32765255d..3967e9e325 100644--- a/saleor/graphql/order/types.py+++ b/saleor/graphql/order/types.py@@ -9,7 +9,8 @@ from ...shipping import models as shipping_modelsfrom ..account.types import Userfrom ..core.fields import PrefetchingConnectionFieldfrom ..core.types.common import CountableDjangoObjectType-from ..core.types.money import Money, TaxedMoney, _str_to_enum+from ..core.types.money import Money, TaxedMoney+from ..core.utils import str_to_enumfrom ..shipping.types import ShippingMethodOrderEventsEnum = graphene.Enum.from_enum(OrderEvents)@@ -17,7 +18,7 @@ OrderEventsEmailsEnum = graphene.Enum.from_enum(OrderEventsEmails)PaymentStatusEnum = graphene.Enum('PaymentStatusEnum',[- (_str_to_enum(code.upper()), code)+ (str_to_enum(code.upper()), code)for code, name in ChargeStatus.CHOICES])diff --git a/saleor/graphql/payment/mutations.py b/saleor/graphql/payment/mutations.pyindex ea0eb04943..1c9bd6d24a 100644--- a/saleor/graphql/payment/mutations.py+++ b/saleor/graphql/payment/mutations.py@@ -113,6 +113,9 @@ class PaymentMethodCapture(BaseMutation):required=True, description='Payment method ID')amount = Decimal(description='Transaction amount')+ class Meta:+ description = 'Captures the authorized payment amount'+@classmethod@permission_required('order.manage_orders')def mutate(cls, root, info, payment_method_id, amount=None):@@ -153,6 +156,9 @@ class PaymentMethodRefund(PaymentMethodCapture):return PaymentMethodRefund(payment_method=payment_method, errors=errors)+ class Meta:+ description = 'Refunds the captured payment amount'+class PaymentMethodVoid(BaseMutation):payment_method = graphene.Field(@@ -162,6 +168,9 @@ class PaymentMethodVoid(BaseMutation):payment_method_id = graphene.ID(required=True, description='Payment method ID')+ class Meta:+ description = 'Voids the authorized payment'+@classmethod@permission_required('order.manage_orders')def mutate(cls, root, info, payment_method_id, amount=None):diff --git a/tests/dashboard/test_order.py b/tests/dashboard/test_order.pyindex 7598bcf204..dcb30f2156 100644--- a/tests/dashboard/test_order.py+++ b/tests/dashboard/test_order.py@@ -156,23 +156,6 @@ def test_view_refund_order_payment_confirmed(assert payment.captured_amount == Money(0, 'USD')-def test_view_refund_order_invalid_payment_waiting_status(- admin_client, order_with_lines, payment_waiting):- order = order_with_lines-- url = reverse(- 'dashboard:refund-payment', kwargs={- 'order_pk': order.pk, 'payment_pk': payment_waiting.pk})- response = admin_client.get(url)- assert response.status_code == 200-- response = admin_client.post(- url, {'csrfmiddlewaretoken': 'hello', 'amount': '20.00'})- assert response.status_code == 400- assert order.payments.last().status == PaymentStatus.WAITING--@pytest.mark.integrationdef test_view_refund_order_invalid_payment_preauth_status(admin_client, order_with_lines, payment_method_txn_preauth):