diff options
| author | Tom Christie | 2013-07-15 21:54:13 +0100 | 
|---|---|---|
| committer | Tom Christie | 2013-07-15 21:54:13 +0100 | 
| commit | 82145e2b06e402c9740ee970c74456a59683667a (patch) | |
| tree | 23f99f421a56ab15e887536ac058c57474b22d59 /rest_framework/test.py | |
| parent | 3eaad89c160c478e3706206535929ad0658ae8c5 (diff) | |
| download | django-rest-framework-82145e2b06e402c9740ee970c74456a59683667a.tar.bz2 | |
Only include APISimpleTestCase and APILiveServerTestCase from django 1.4 onwards
Diffstat (limited to 'rest_framework/test.py')
| -rw-r--r-- | rest_framework/test.py | 13 | 
1 files changed, 7 insertions, 6 deletions
| diff --git a/rest_framework/test.py b/rest_framework/test.py index ed436976..a18f5a29 100644 --- a/rest_framework/test.py +++ b/rest_framework/test.py @@ -3,6 +3,7 @@  # Note that we import as `DjangoRequestFactory` and `DjangoClient` in order  # to make it harder for the user to import the wrong thing without realizing.  from __future__ import unicode_literals +import django  from django.conf import settings  from django.test.client import Client as DjangoClient  from django.test.client import ClientHandler @@ -140,10 +141,6 @@ class APIClient(APIRequestFactory, DjangoClient):          return super(APIClient, self).request(**kwargs) -class APISimpleTestCase(testcases.SimpleTestCase): -    client_class = APIClient - -  class APITransactionTestCase(testcases.TransactionTestCase):      client_class = APIClient @@ -152,5 +149,9 @@ class APITestCase(testcases.TestCase):      client_class = APIClient -class APILiveServerTestCase(testcases.LiveServerTestCase): -    client_class = APIClient +if django.VERSION >= (1, 4): +    class APISimpleTestCase(testcases.SimpleTestCase): +        client_class = APIClient + +    class APILiveServerTestCase(testcases.LiveServerTestCase): +        client_class = APIClient | 
