Skip to content

Commit

Permalink
Merge pull request #143 from uploadcare/add-pythons-and-djangos
Browse files Browse the repository at this point in the history
Fix widget rendering in django 2.1+
  • Loading branch information
dmitry-mukhin committed Nov 8, 2018
2 parents f7a6758 + 174d324 commit fd42c9d
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 21 deletions.
47 changes: 31 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,60 +14,75 @@ env:
- SUITE="tests/functional"
matrix:
include:
- python: 3.7
dist: xenial
sudo: true

# django tests
- stage: django tests

# django 1.11
python: 2.7
env:
- DJANGO=1.8
- DJANGO=1.11
- SUITE="tests/dj"
- python: 2.7
- python: 3.4
env:
- DJANGO=1.11
- SUITE="tests/dj"

- python: 3.4
- python: 3.5
env:
- DJANGO=1.8
- DJANGO=1.11
- SUITE="tests/dj"
- python: 3.4
- python: 3.6
env:
- DJANGO=1.11
- SUITE="tests/dj"

# django 2.0

- python: 3.4
env:
- DJANGO=2.0
- SUITE="tests/dj"
- python: 3.5
env:
- DJANGO=1.8
- DJANGO=2.0
- SUITE="tests/dj"
- python: 3.5
- python: 3.6
env:
- DJANGO=1.11
- DJANGO=2.0
- SUITE="tests/dj"
- python: 3.5
- python: 3.7
dist: xenial
sudo: true
env:
- DJANGO=2.0
- SUITE="tests/dj"
- python: 3.6

# django 2.1

- python: 3.5
env:
- DJANGO=1.8
- DJANGO=2.1
- SUITE="tests/dj"
- python: 3.6
env:
- DJANGO=1.11
- DJANGO=2.1
- SUITE="tests/dj"
- python: 3.6
- python: 3.7
dist: xenial
sudo: true
env:
- DJANGO=2.0
- DJANGO=2.1
- SUITE="tests/dj"

# integration tests
- stage: integration tests
python: 2.7
env: SUITE="tests/integration"
- stage: integration tests
python: 3.5
python: 3.6
env: SUITE="tests/integration"

cache:
Expand Down
9 changes: 9 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
History
-------

Unreleased
~~~~~~~~~~

Fixed
+++++

- `FileWidget.render()` now works in Django 2.1.


2.5.0
~~~~~

Expand Down
4 changes: 2 additions & 2 deletions pyuploadcare/dj/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def __init__(self, attrs=None):

super(FileWidget, self).__init__(default_attrs)

def render(self, name, value, attrs):
return super(FileWidget, self).render(name, value, attrs)
def render(self, name, value, attrs=None, renderer=None):
return super(FileWidget, self).render(name, value, attrs, renderer)


class FileField(Field):
Expand Down
9 changes: 6 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ envlist=
# core lib tests
py{27,34,35,36}-api,
# old django versions
py27-dj1.{4,5,6,7,9,10}-django
py27-dj1.{4,5,6,7,8,9,10}-django
py34-dj1.7-django
py35-dj1.{9,10}-django
# current django versions
py{27,34,35.36}-dj1.{8,11}-django
py{34,35,36}-dj2.0-django
py{27,34,35,36}-dj1.11-django
py{34,35,36,37}-dj2.0-django
py{35,36,37}-dj2.1-django
# integration tests
py27-integration

Expand All @@ -22,6 +23,7 @@ basepython =
py34: python3.4
py35: python3.5
py36: python3.6
py37: python3.7
deps =
pytest
mock
Expand All @@ -34,6 +36,7 @@ deps =
dj1.10: Django~=1.10.0
dj1.11: Django~=1.11.0
dj2.0: Django~=2.0.0
dj2.1: Django~=2.1.0
commands =
api: py.test tests/functional
django: py.test tests/dj
Expand Down

0 comments on commit fd42c9d

Please sign in to comment.