Reading from request is allowed after accessing request contents as POST or body.
(self)
| 343 | self.assertEqual(request.readline(), b"other=string") |
| 344 | |
| 345 | def test_read_after_value(self): |
| 346 | """ |
| 347 | Reading from request is allowed after accessing request contents as |
| 348 | POST or body. |
| 349 | """ |
| 350 | payload = FakePayload("name=value") |
| 351 | request = WSGIRequest( |
| 352 | { |
| 353 | "REQUEST_METHOD": "POST", |
| 354 | "CONTENT_TYPE": "application/x-www-form-urlencoded", |
| 355 | "CONTENT_LENGTH": len(payload), |
| 356 | "wsgi.input": payload, |
| 357 | } |
| 358 | ) |
| 359 | self.assertEqual(request.POST, {"name": ["value"]}) |
| 360 | self.assertEqual(request.body, b"name=value") |
| 361 | self.assertEqual(request.read(), b"name=value") |
| 362 | |
| 363 | def test_value_after_read(self): |
| 364 | """ |
nothing calls this directly
no test coverage detected