Remove Django 1.10 from tests and move imports to top of the file

This commit is contained in:
Maxim Kukhtenkov 2017-12-05 00:23:37 -05:00
parent fcca39643e
commit 7ad440f7a2
2 changed files with 5 additions and 7 deletions

View File

@ -5,7 +5,6 @@ python:
- "3.6" - "3.6"
env: env:
- DJANGO=1.8.* DRF=3.6.* - DJANGO=1.8.* DRF=3.6.*
- DJANGO=1.10.* DRF=3.7.*
- DJANGO=1.11.* DRF=3.7.* - DJANGO=1.11.* DRF=3.7.*
- DJANGO=2.0.* DRF=3.7.* - DJANGO=2.0.* DRF=3.7.*
install: install:

View File

@ -7,6 +7,11 @@ from django.utils.encoding import force_text
from rest_framework import status from rest_framework import status
from rest_framework import permissions from rest_framework import permissions
try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse
class CustomPermissionClass(permissions.BasePermission): class CustomPermissionClass(permissions.BasePermission):
message = 'You shall not pass!' message = 'You shall not pass!'
@ -14,11 +19,6 @@ 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):
@ -30,7 +30,6 @@ class APIClient(Client):
class TestsMixin(object): class TestsMixin(object):
""" """
base for API tests: base for API tests:
* easy request calls, f.e.: self.post(url, data), self.get(url) * easy request calls, f.e.: self.post(url, data), self.get(url)