MCPcopy
hub / github.com/django/django / request

Method request

django/test/client.py:719–731  ·  view source on GitHub ↗

Construct a generic request object.

(self, **request)

Source from the content-addressed store, hash-verified

717 return scope
718
719 def request(self, **request):
720 """Construct a generic request object."""
721 # This is synchronous, which means all methods on this class are.
722 # AsyncClient, however, has an async request function, which makes all
723 # its methods async.
724 if "_body_file" in request:
725 body_file = request.pop("_body_file")
726 else:
727 body_file = FakePayload("")
728 # Wrap FakePayload body_file to allow large read() in test environment.
729 return ASGIRequest(
730 self._base_scope(**request), LimitedStream(body_file, len(body_file))
731 )
732
733 def generic(
734 self,

Callers 5

genericMethod · 0.95
test_root_pathMethod · 0.95

Calls 5

_base_scopeMethod · 0.95
ASGIRequestClass · 0.90
LimitedStreamClass · 0.90
FakePayloadClass · 0.85
popMethod · 0.45

Tested by 4

test_root_pathMethod · 0.76