mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2024-11-10 19:26:35 +03:00
Merge pull request #391 from michael-k/patch-1
Run tests against Django 2.0
This commit is contained in:
commit
fcca39643e
|
@ -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.*
|
||||
|
|
|
@ -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):
|
||||
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue
Block a user