| 32 | Code the reproduce is this: |
| 33 | |
| 34 | {{{ |
| 35 | class AsyncRequestFactoryTestPassingData(SimpleTestCase): |
| 36 | request_factory = AsyncRequestFactory() |
| 37 | |
| 38 | async def test_request_factory(self): |
| 39 | async def async_generic_view(request): |
| 40 | return HttpResponse(status=200, content=request.body) |
| 41 | |
| 42 | request = self.request_factory.post('/somewhere/', data={'example': 'data'}, content_type="application/json") |
| 43 | response = await async_generic_view(request) |
| 44 | self.assertEqual(response.status_code, 200) |
| 45 | self.assertEqual(response.content, b'{"example": "data"}') |
| 46 | }}} |
| 47 | |
| 48 | |