compat: invert logic for checking the django version when implementing

RequestFactory.generic()
This commit is contained in:
Markus Korn 2015-06-22 16:13:42 +02:00
parent aa1ad4fb64
commit b42b16d0e6

View File

@ -210,7 +210,9 @@ except ImportError:
# RequestFactory only provides `generic` from 1.5 onwards # 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 from django.test.client import RequestFactory as DjangoRequestFactory
class RequestFactory(DjangoRequestFactory): class RequestFactory(DjangoRequestFactory):
@ -231,8 +233,6 @@ if django.VERSION < (1, 5):
}) })
r.update(extra) r.update(extra)
return self.request(**r) return self.request(**r)
else:
from django.test.client import RequestFactory
# Markdown is optional # Markdown is optional