Skip to content
This repository was archived by the owner on May 26, 2020. It is now read-only.

Adding test support for Django 2.0 / DRF 3.7, 3.8 #443

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -50,19 +50,6 @@ matrix:
- python: 2.7
env: TOXENV=py27-dj111-drf36-codecov

- python: 3.3
env: TOXENV=py33-dj18-drf31-codecov
- python: 3.3
env: TOXENV=py33-dj18-drf32-codecov
- python: 3.3
env: TOXENV=py33-dj18-drf33-codecov
- python: 3.3
env: TOXENV=py33-dj18-drf34-codecov
- python: 3.3
env: TOXENV=py33-dj18-drf35-codecov
- python: 3.3
env: TOXENV=py33-dj18-drf36-codecov

- python: 3.4
env: TOXENV=py34-dj18-drf31-codecov
- python: 3.4
@@ -130,6 +117,17 @@ matrix:
env: TOXENV=py36-dj111-drf35-codecov
- python: 3.6
env: TOXENV=py36-dj111-drf36-codecov
- python: 3.6
env: TOXENV=py36-dj111-drf37-codecov
- python: 3.6
env: TOXENV=py36-dj111-drf38-codecov


- python: 3.6
env: TOXENV=py36-dj20-drf37-codecov
- python: 3.6
env: TOXENV=py36-dj20-drf38-codecov


install:
- pip install tox
6 changes: 4 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -23,8 +23,10 @@ Requirements
------------

- Python (2.7, 3.3, 3.4, 3.5, 3.6)
- Django (1.8, 1.9, 1.10, 1.11)
- Django REST Framework (3.1, 3.2, 3.3, 3.4, 3.5, 3.6)
- Django (1.8, 1.9, 1.10, 1.11, 2.0\*)
- Django REST Framework (3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7\*, 3.8\*)

\* Django 2.0 is tested only on Python 3.6 and Django REST Framework 3.7, 3.8

Installation
------------
6 changes: 4 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -28,8 +28,10 @@ If you want to know more about JWT, check out the following resources:
## Requirements

- Python (2.7, 3.3, 3.4, 3.5, 3.6)
- Django (1.8, 1.9, 1.10)
- Django REST Framework (3.0, 3.1, 3.2, 3.3, 3.4, 3.5)
- Django (1.8, 1.9, 1.10, 1.11, 2.0\*)
- Django REST Framework (3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7\*, 3.8\*)

\* Django 2.0 is tested only on Python 3.6 and Django Rest Framework 3.7, 3.8

## Security

7 changes: 5 additions & 2 deletions tests/test_serializers.py
Original file line number Diff line number Diff line change
@@ -15,6 +15,9 @@
drf2 = rest_framework.VERSION < StrictVersion('3.0.0')
drf3 = rest_framework.VERSION >= StrictVersion('3.0.0')

django_strict_version = StrictVersion('%s.%s.%s' % django.VERSION[:3])
django2 = django_strict_version > StrictVersion('1.10.0')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And then Django 1.11 happened ;-)

In any case, the older PR #398 did this.



class JSONWebTokenSerializerTests(TestCase):
def setUp(self):
@@ -71,7 +74,7 @@ def test_invalid_credentials(self):
self.assertEqual(serializer.errors, expected_error)

@unittest.skipIf(
django.VERSION[1] >= 10,
django2,
reason='The ModelBackend does not permit login when is_active is False.')
def test_disabled_user(self):
self.user.is_active = False
@@ -88,7 +91,7 @@ def test_disabled_user(self):
self.assertEqual(serializer.errors, expected_error)

@unittest.skipUnless(
django.VERSION[1] >= 10,
django2,
reason='The AllowAllUsersModelBackend permits login when is_active is False.')
@override_settings(AUTHENTICATION_BACKENDS=[
'django.contrib.auth.backends.AllowAllUsersModelBackend'])
5 changes: 4 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
envlist =
py27-{flake8,docs},
{py27,py33,py34,py35,py36}-dj{18,19,110,111}-drf{31,32,33,34,35,36}
{py27,py33,py34,py35,py36}-dj{18,19,110,111,20}-drf{31,32,33,34,35,36,37,38,39}

[testenv]
commands =
@@ -15,12 +15,15 @@ deps =
dj19: Django<1.10
dj110: Django<1.11
dj111: Django<1.12
dj20: Django<2.1
drf31: djangorestframework<3.2
drf32: djangorestframework<3.3
drf33: djangorestframework<3.4
drf34: djangorestframework<3.5
drf35: djangorestframework<3.6
drf36: djangorestframework<3.7
drf37: djangorestframework<3.8
drf38: djangorestframework<3.9
py27-dj{18,19}-drf{31,32,33,34}: djangorestframework-oauth==1.0.1
-rrequirements/testing.txt
coverage: coverage