mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 17:47:04 +03:00
compat: invert logic for checking the django version when implementing
RequestFactory.generic()
This commit is contained in:
parent
aa1ad4fb64
commit
b42b16d0e6
|
@ -210,7 +210,9 @@ except ImportError:
|
|||
|
||||
|
||||
# RequestFactory only provides `generic` from 1.5 onwards
|
||||
if django.VERSION < (1, 5):
|
||||
if django.VERSION >= (1, 5):
|
||||
from django.test.client import RequestFactory
|
||||
else:
|
||||
from django.test.client import RequestFactory as DjangoRequestFactory
|
||||
|
||||
class RequestFactory(DjangoRequestFactory):
|
||||
|
@ -231,8 +233,6 @@ if django.VERSION < (1, 5):
|
|||
})
|
||||
r.update(extra)
|
||||
return self.request(**r)
|
||||
else:
|
||||
from django.test.client import RequestFactory
|
||||
|
||||
|
||||
# Markdown is optional
|
||||
|
|
Loading…
Reference in New Issue
Block a user