Skip to content

Commit

Permalink
Merge pull request #162 from sunscrapers/Stranger6667-update-tox
Browse files Browse the repository at this point in the history
Update tests, configs, and documentation to Django 1.10
  • Loading branch information
mmarksnippety authored Sep 1, 2016
2 parents 444d9b5 + 4ce3c01 commit 3bd5cec
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 21 deletions.
10 changes: 4 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,19 @@ env:
- TOX_ENV=py27-dj17-drf33
- TOX_ENV=py27-dj18-drf33
- TOX_ENV=py27-dj19-drf33
- TOX_ENV=py27-dj110a-drf33
- TOX_ENV=py32-dj17-drf33
- TOX_ENV=py27-dj110-drf33
- TOX_ENV=py33-dj17-drf33
- TOX_ENV=py34-dj17-drf33
- TOX_ENV=py32-dj18-drf33
- TOX_ENV=py33-dj18-drf33
- TOX_ENV=py34-dj18-drf33
- TOX_ENV=py35-dj18-drf33
- TOX_ENV=py34-dj19-drf33
- TOX_ENV=py35-dj19-drf33
- TOX_ENV=py34-dj110a-drf33
- TOX_ENV=py35-dj110a-drf33
- TOX_ENV=py34-dj110-drf33
- TOX_ENV=py35-dj110-drf33

install:
- travis_retry pip install "virtualenv<14.0.0" "tox>=1.9"
- travis_retry pip install virtualenv tox

script:
- tox -e $TOX_ENV
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Supported Django versions:
* Django 1.7
* Django 1.8
* Django 1.9
* Django 1.10

Supported Django Rest Framework versions:

Expand Down Expand Up @@ -556,7 +557,7 @@ In this extremely short tutorial we are going to mimic the simplest flow: regist

`$ curl -X POST http://127.0.0.1:8088/auth/register/ --data 'username=djoser&password=djoser'`

`{"email": "", "username": "djoser"}`
`{"email": "", "username": "djoser", "id":1}`

So far, so good. We have just created a new user using REST API.

Expand Down Expand Up @@ -586,7 +587,7 @@ In this extremely short tutorial we are going to mimic the simplest flow: regist

`$ curl -X GET http://127.0.0.1:8088/auth/me/ -H 'Authorization: Token b704c9fc3655635646356ac2950269f352ea1139'`

`{"email": "", "username": "djoser"}`
`{"email": "", "username": "djoser", "id": 1}`

Yay, it works!

Expand Down
8 changes: 4 additions & 4 deletions testproject/testapp/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ def test_post_should_login_user(self):
self.assertEqual(response.data['auth_token'], user.auth_token.key)
self.assertTrue(self.signal_sent)

@unittest2.skipIf(django.VERSION >= (1, 10, 0, 'alpha', 1),
"in this version authenticate() returns None if user is inactive")
@unittest2.skipIf(django.VERSION >= (1, 10),
"in this version authenticate() returns None if user is inactive")
def test_post_should_not_login_if_user_is_not_active(self):
user = create_user()
data = {
Expand All @@ -185,8 +185,8 @@ def test_post_should_not_login_if_user_is_not_active(self):
self.assertEqual(response.data['non_field_errors'], [djoser.constants.INACTIVE_ACCOUNT_ERROR])
self.assertFalse(self.signal_sent)

@unittest2.skipIf(django.VERSION < (1, 10, 0, 'alpha', 1),
"in these versions authenticate() succeedes if user is inactive")
@unittest2.skipIf(django.VERSION < (1, 10),
"in these versions authenticate() succeedes if user is inactive")
def test_post_should_not_login_if_user_is_not_active(self):
user = create_user()
data = {
Expand Down
15 changes: 6 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
[tox]
downloadcache = {toxworkdir}/cache/
envlist =
py27-dj{17,18,19,110a}-drf33,
py{32,33,34}-dj17-drf33,
py{32,33,34,35}-dj18-drf33,
py{34,35}-dj{19,110a}-drf33
py27-dj{17,18,19,110}-drf33,
py{33,34}-dj17-drf33,
py{33,34,35}-dj18-drf33,
py{34,35}-dj{19,110}-drf33

[testenv]
basepython =
py27: python2.7
py32: python3.2
py33: python3.3
py34: python3.4
py35: python3.5
deps =
dj17: django>=1.7,<1.8
dj18: django>=1.8,<1.9
dj19: django>=1.9,<1.10
dj110a: django>=1.10a,<1.11
drf32: djangorestframework>=3.2,<3.3
dj110: django>=1.10,<1.11
drf33: djangorestframework>=3.3,<3.4
py32: mock<1.1
py{26,27}: mock
py27: mock
-rrequirements-test.txt
commands = coverage run --source=djoser testproject/manage.py test testapp

0 comments on commit 3bd5cec

Please sign in to comment.