Merge pull request #391 from michael-k/patch-1

Run tests against Django 2.0
This commit is contained in:
Maxim Kukhtenkov 2017-12-05 00:20:31 -05:00 committed by GitHub
commit fcca39643e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 2 deletions

View File

@ -7,6 +7,7 @@ env:
- DJANGO=1.8.* DRF=3.6.*
- DJANGO=1.10.* DRF=3.7.*
- DJANGO=1.11.* DRF=3.7.*
- DJANGO=2.0.* DRF=3.7.*
install:
- pip install -q Django==$DJANGO djangorestframework==$DRF
- pip install coveralls
@ -17,3 +18,7 @@ after_success:
- coveralls
before_script:
- flake8 . --config=flake8
matrix:
exclude:
- python: "2.7"
env: DJANGO=2.0.* DRF=3.7.*

View File

@ -1,7 +1,6 @@
import json
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test.client import Client, MULTIPART_CONTENT
from django.utils.encoding import force_text
@ -15,6 +14,11 @@ class CustomPermissionClass(permissions.BasePermission):
def has_permission(self, request, view):
return False
try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse
class APIClient(Client):

View File

@ -1,4 +1,3 @@
from django.core.urlresolvers import reverse
from django.test import TestCase, override_settings
from django.contrib.auth import get_user_model
from django.core import mail
@ -14,6 +13,11 @@ from rest_auth.registration.app_settings import register_permission_classes
from .mixins import TestsMixin, CustomPermissionClass
try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse
@override_settings(ROOT_URLCONF="tests.urls")
class APIBasicTests(TestsMixin, TestCase):