mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2024-11-22 09:06:40 +03:00
Fixes import path for django's reverse
This commit is contained in:
parent
864aa60f92
commit
3a2a256821
|
@ -1,7 +1,6 @@
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core.urlresolvers import reverse
|
|
||||||
from django.test.client import Client, MULTIPART_CONTENT
|
from django.test.client import Client, MULTIPART_CONTENT
|
||||||
from django.utils.encoding import force_text
|
from django.utils.encoding import force_text
|
||||||
|
|
||||||
|
@ -15,6 +14,11 @@ class CustomPermissionClass(permissions.BasePermission):
|
||||||
def has_permission(self, request, view):
|
def has_permission(self, request, view):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
try:
|
||||||
|
from django.urls import reverse
|
||||||
|
except ImportError:
|
||||||
|
from django.core.urlresolvers import reverse
|
||||||
|
|
||||||
|
|
||||||
class APIClient(Client):
|
class APIClient(Client):
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
from django.core.urlresolvers import reverse
|
|
||||||
from django.test import TestCase, override_settings
|
from django.test import TestCase, override_settings
|
||||||
from django.contrib.auth import get_user_model
|
from django.contrib.auth import get_user_model
|
||||||
from django.core import mail
|
from django.core import mail
|
||||||
|
@ -14,6 +13,11 @@ from rest_auth.registration.app_settings import register_permission_classes
|
||||||
|
|
||||||
from .mixins import TestsMixin, CustomPermissionClass
|
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")
|
@override_settings(ROOT_URLCONF="tests.urls")
|
||||||
class APIBasicTests(TestsMixin, TestCase):
|
class APIBasicTests(TestsMixin, TestCase):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user