From 7ad440f7a2322ed936478fbbceab7c6afd4d8847 Mon Sep 17 00:00:00 2001 From: Maxim Kukhtenkov Date: Tue, 5 Dec 2017 00:23:37 -0500 Subject: [PATCH] Remove Django 1.10 from tests and move imports to top of the file --- .travis.yml | 1 - rest_auth/tests/mixins.py | 11 +++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8470da1..b05a3f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,6 @@ python: - "3.6" 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: diff --git a/rest_auth/tests/mixins.py b/rest_auth/tests/mixins.py index 91f0001..220a28d 100644 --- a/rest_auth/tests/mixins.py +++ b/rest_auth/tests/mixins.py @@ -7,6 +7,11 @@ from django.utils.encoding import force_text from rest_framework import status from rest_framework import permissions +try: + from django.urls import reverse +except ImportError: + from django.core.urlresolvers import reverse + class CustomPermissionClass(permissions.BasePermission): message = 'You shall not pass!' @@ -14,11 +19,6 @@ 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): @@ -30,7 +30,6 @@ class APIClient(Client): class TestsMixin(object): - """ base for API tests: * easy request calls, f.e.: self.post(url, data), self.get(url)