Commit b42b16d0 by Markus Korn

compat: invert logic for checking the django version when implementing

RequestFactory.generic()
parent aa1ad4fb
...@@ -210,7 +210,9 @@ except ImportError: ...@@ -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): ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment