From 019f1ec1def47a081e512c08244ca08db3a0c9f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Dlouh=C3=BD?= Date: Tue, 17 Mar 2020 07:48:51 +0100 Subject: [PATCH 1/3] use working version of Braintree with Python2 --- setup.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/setup.py b/setup.py index 5b409863d..138694267 100755 --- a/setup.py +++ b/setup.py @@ -31,6 +31,11 @@ 'xmltodict>=0.9.2'] +# Braintree does not support Python 2 from version 4.0.0 +if sys.version_info[0] <= 2: + REQUIREMENTS[0] = 'braintree>=3.14.0,<4.0.0' + + class PyTest(TestCommand): user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")] test_args = [] From 0b40dab04dc887d8250334afa930874b3b343975 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Dlouh=C3=BD?= Date: Tue, 17 Mar 2020 07:57:06 +0100 Subject: [PATCH 2/3] add testing in newer Django versions --- .travis.yml | 12 ++++++++++++ tox.ini | 6 +++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a2571c806..e99791a8e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,8 @@ python: env: - DJANGO="1.11" - DJANGO="2.1" + - DJANGO="2.2" + - DJANGO="3.0" - DJANGO="master" matrix: include: @@ -14,6 +16,14 @@ matrix: sudo: required dist: xenial env: DJANGO="2.1" + - python: "3.7" + sudo: required + dist: xenial + env: DJANGO="2.2" + - python: "3.7" + sudo: required + dist: xenial + env: DJANGO="3.0" - python: "3.7" sudo: required dist: xenial @@ -30,6 +40,8 @@ matrix: env: DJANGO="2.1" - python: "2.7" env: DJANGO="master" + - python: "3.5" + env: DJANGO="3.0" after_success: codecov install: pip install tox-travis codecov script: tox diff --git a/tox.ini b/tox.ini index 0340f03ec..cf03ecaf2 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27-django111, py{35,36,37}-django{111,21,_master} +envlist = py27-django111, py{35,36,37}-django{111,21,22,30,_master} [testenv] usedevelop=True @@ -7,6 +7,8 @@ deps= coverage django111: django>=1.11a1,<1.12 django21: Django>=2.1a1,<2.2 + django22: Django>=2.2,<3.0 + django30: Django>=3.0,<3.1 django_master: https://github.com/django/django/archive/master.tar.gz mock pytest @@ -29,4 +31,6 @@ unignore_outcomes = True DJANGO = 1.11: django111 2.1: django21 + 2.2: django22 + 3.0: django30 master: django_master From 62df3789685731cca2e60b972f560221cf313e1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Dlouh=C3=BD?= Date: Tue, 17 Mar 2020 08:47:20 +0100 Subject: [PATCH 3/3] fix wallet in Django>=2.2 --- payments/wallet/widgets.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/payments/wallet/widgets.py b/payments/wallet/widgets.py index f689c514f..3093b60d7 100644 --- a/payments/wallet/widgets.py +++ b/payments/wallet/widgets.py @@ -19,5 +19,8 @@ def __init__(self, provider, payment, *args, **kwargs): @property def media(self): media = super(WalletWidget, self).media - media._js = self.js + try: # Django < 2.2 + media._js = self.js + except AttributeError: + media._js_lists = [self.js] return media