Don’t rely on Django’s get as it breaks for 1.7

This commit is contained in:
Xavier Ordoquy 2014-01-28 18:53:58 +01:00
parent 6aadd1639b
commit da89cfc937

View File

@ -71,6 +71,10 @@ class APIRequestFactory(DjangoRequestFactory):
return ret, content_type return ret, content_type
def get(self, path, data=None, format=None, content_type=None, **extra):
data, content_type = self._encode_data(data, format, content_type)
return self.generic('GET', path, data, content_type, **extra)
def post(self, path, data=None, format=None, content_type=None, **extra): def post(self, path, data=None, format=None, content_type=None, **extra):
data, content_type = self._encode_data(data, format, content_type) data, content_type = self._encode_data(data, format, content_type)
return self.generic('POST', path, data, content_type, **extra) return self.generic('POST', path, data, content_type, **extra)