MCPcopy
hub / github.com/django/django / test_stream_readline

Method test_stream_readline

tests/requests_tests/tests.py:332–343  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

330 self.assertEqual(request.read(), b"name=value")
331
332 def test_stream_readline(self):
333 payload = FakePayload("name=value\nother=string")
334 request = WSGIRequest(
335 {
336 "REQUEST_METHOD": "POST",
337 "CONTENT_TYPE": "application/x-www-form-urlencoded",
338 "CONTENT_LENGTH": len(payload),
339 "wsgi.input": payload,
340 },
341 )
342 self.assertEqual(request.readline(), b"name=value\n")
343 self.assertEqual(request.readline(), b"other=string")
344
345 def test_read_after_value(self):
346 """

Callers

nothing calls this directly

Calls 3

FakePayloadClass · 0.90
WSGIRequestClass · 0.90
readlineMethod · 0.45

Tested by

no test coverage detected