Skip to content

Commit

Permalink
Merge pull request #216 from PetrDlouhy/django30
Browse files Browse the repository at this point in the history
Fix testing with Python 2 and Django>=2.2
  • Loading branch information
patrys authored Mar 17, 2020
2 parents 02931b0 + 62df378 commit 04103a6
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,23 @@ python:
env:
- DJANGO="1.11"
- DJANGO="2.1"
- DJANGO="2.2"
- DJANGO="3.0"
- DJANGO="master"
matrix:
include:
- python: "3.7"
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
Expand All @@ -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
5 changes: 4 additions & 1 deletion payments/wallet/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down
6 changes: 5 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
[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
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
Expand All @@ -29,4 +31,6 @@ unignore_outcomes = True
DJANGO =
1.11: django111
2.1: django21
2.2: django22
3.0: django30
master: django_master

0 comments on commit 04103a6

Please sign in to comment.