diff --git a/django/test/client.py b/django/test/client.py
index 5cbc0ca..e4c48fb 100644
a
|
b
|
class RequestFactory(object):
|
198 | 198 | 'wsgi.multiprocess': True, |
199 | 199 | 'wsgi.multithread': False, |
200 | 200 | 'wsgi.run_once': False, |
| 201 | 'wsgi.input': FakePayload(''), |
201 | 202 | } |
202 | 203 | environ.update(self.defaults) |
203 | 204 | environ.update(request) |
… |
… |
class RequestFactory(object):
|
223 | 224 | 'PATH_INFO': self._get_path(parsed), |
224 | 225 | 'QUERY_STRING': urlencode(data, doseq=True) or parsed[4], |
225 | 226 | 'REQUEST_METHOD': 'GET', |
226 | | 'wsgi.input': FakePayload('') |
227 | 227 | } |
228 | 228 | r.update(extra) |
229 | 229 | return self.request(**r) |
… |
… |
class RequestFactory(object):
|
264 | 264 | 'PATH_INFO': self._get_path(parsed), |
265 | 265 | 'QUERY_STRING': urlencode(data, doseq=True) or parsed[4], |
266 | 266 | 'REQUEST_METHOD': 'HEAD', |
267 | | 'wsgi.input': FakePayload('') |
268 | 267 | } |
269 | 268 | r.update(extra) |
270 | 269 | return self.request(**r) |
… |
… |
class RequestFactory(object):
|
277 | 276 | 'PATH_INFO': self._get_path(parsed), |
278 | 277 | 'QUERY_STRING': urlencode(data, doseq=True) or parsed[4], |
279 | 278 | 'REQUEST_METHOD': 'OPTIONS', |
280 | | 'wsgi.input': FakePayload('') |
281 | 279 | } |
282 | 280 | r.update(extra) |
283 | 281 | return self.request(**r) |
… |
… |
class RequestFactory(object):
|
317 | 315 | 'PATH_INFO': self._get_path(parsed), |
318 | 316 | 'QUERY_STRING': urlencode(data, doseq=True) or parsed[4], |
319 | 317 | 'REQUEST_METHOD': 'DELETE', |
320 | | 'wsgi.input': FakePayload('') |
321 | 318 | } |
322 | 319 | r.update(extra) |
323 | 320 | return self.request(**r) |
diff --git a/tests/modeltests/test_client/models.py b/tests/modeltests/test_client/models.py
index 16bdd2d..1389695 100644
a
|
b
|
class RequestFactoryTest(TestCase):
|
488 | 488 | |
489 | 489 | self.assertEqual(response.status_code, 200) |
490 | 490 | self.assertContains(response, 'This is a test') |
| 491 | |
| 492 | def test_generic_request(self): |
| 493 | factory = RequestFactory() |
| 494 | request = factory.request() |
| 495 | response = get_view(request) |
| 496 | |
| 497 | self.assertEqual(response.status_code, 200) |
| 498 | self.assertContains(response, 'This is a test') |