Skip to content

Commit

Permalink
Add support for Django 4
Browse files Browse the repository at this point in the history
  • Loading branch information
const-cloudinary authored Jan 13, 2022
1 parent a9dd822 commit 8c968f9
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 33 deletions.
26 changes: 3 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,42 +11,22 @@ matrix:
env: TOXENV=py38-core
- python: 3.9
env: TOXENV=py39-core
- python: 2.7
env: TOXENV=py27-django18
- python: 3.5
env: TOXENV=py35-django18
- python: 2.7
env: TOXENV=py27-django19
- python: 3.5
env: TOXENV=py35-django19
- python: 2.7
env: TOXENV=py27-django110
- python: 3.6
env: TOXENV=py36-django110
- python: 2.7
env: TOXENV=py27-django111
- python: 3.6
env: TOXENV=py36-django111
- python: 3.5
env: TOXENV=py35-django20
- python: 3.7
env: TOXENV=py37-django20
- python: 3.7
env: TOXENV=py37-django21
- python: 3.7
env: TOXENV=py37-django22
- python: 3.6
env: TOXENV=py36-django30
- python: 3.8
env: TOXENV=py38-django30
- python: 3.6
env: TOXENV=py36-django31
- python: 3.7
env: TOXENV=py37-django31
- python: 3.8
env: TOXENV=py38-django31
- python: 3.9
env: TOXENV=py39-django31
env: TOXENV=py39-django32
- python: 3.9
env: TOXENV=py39-django40
install:
- pip install tox

Expand Down
2 changes: 2 additions & 0 deletions django_tests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

@python_2_unicode_compatible
class Poll(models.Model):
id = models.AutoField(primary_key=True)
question = models.CharField(max_length=200)
image_width = models.PositiveIntegerField(null=True)
image_height = models.PositiveIntegerField(null=True)
Expand All @@ -17,6 +18,7 @@ def __str__(self):

@python_2_unicode_compatible
class Choice(models.Model):
id = models.AutoField(primary_key=True)
poll = models.ForeignKey(Poll, on_delete=models.CASCADE)
choice = models.CharField(max_length=200)
votes = models.IntegerField()
Expand Down
7 changes: 6 additions & 1 deletion django_tests/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
from django.conf.urls import url
import django

if int(django.__version__[0]) > 3:
from django.urls import re_path as url
else:
from django.conf.urls import url

from .views import index

Expand Down
17 changes: 8 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
[tox]
envlist =
py{27,34,35,36,37,38,39}-core
py{27,34,35}-django{18,19,110}
py{27,34,35,36}-django{111}
py{36,37,38,39}-django{20,21,22,30,31}
py{27,36,37,38,39}-core
py{27,36}-django{111}
py{36,37,38,39}-django{20,21,22,30,31,32,40}
[testenv]
usedevelop = True
commands =
core: python setup.py test {env:P_ARGS:}
django{18,19,110,111,20,21,22,30,31}: django-admin.py test -v2 django_tests {env:D_ARGS:}
django{111,20,21,22,30,31,32}: django-admin.py test -v2 django_tests {env:D_ARGS:}
django{40}: django-admin test -v2 django_tests {env:D_ARGS:}
passenv = *
deps =
django{18,19,110,111,20,21,22,30,31}: mock
django18: Django>=1.8,<1.9
django19: Django>=1.9,<1.10
django110: Django>=1.10,<1.11
django{111,20,21,22,30,31,32,40}: mock
django111: Django>=1.11,<1.12
django20: Django>=2.0,<2.1
django21: Django>=2.1,<2.2
django22: Django>=2.2,<2.3
django30: Django>=3.0,<3.1
django31: Django>=3.1,<3.2
django32: Django>=3.2,<3.3
django40: Django>=4.0,<4.1
setenv =
DJANGO_SETTINGS_MODULE=django_tests.settings

0 comments on commit 8c968f9

Please sign in to comment.