Skip to content

Commit 82145e2

Browse files
committed
Only include APISimpleTestCase and APILiveServerTestCase from django 1.4 onwards
1 parent 3eaad89 commit 82145e2

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

rest_framework/test.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Note that we import as `DjangoRequestFactory` and `DjangoClient` in order
44
# to make it harder for the user to import the wrong thing without realizing.
55
from __future__ import unicode_literals
6+
import django
67
from django.conf import settings
78
from django.test.client import Client as DjangoClient
89
from django.test.client import ClientHandler
@@ -140,10 +141,6 @@ def request(self, **kwargs):
140141
return super(APIClient, self).request(**kwargs)
141142

142143

143-
class APISimpleTestCase(testcases.SimpleTestCase):
144-
client_class = APIClient
145-
146-
147144
class APITransactionTestCase(testcases.TransactionTestCase):
148145
client_class = APIClient
149146

@@ -152,5 +149,9 @@ class APITestCase(testcases.TestCase):
152149
client_class = APIClient
153150

154151

155-
class APILiveServerTestCase(testcases.LiveServerTestCase):
156-
client_class = APIClient
152+
if django.VERSION >= (1, 4):
153+
class APISimpleTestCase(testcases.SimpleTestCase):
154+
client_class = APIClient
155+
156+
class APILiveServerTestCase(testcases.LiveServerTestCase):
157+
client_class = APIClient

0 commit comments

Comments
 (0)