MCPcopy
hub / github.com/django/django / test_asgi_cookies

Method test_asgi_cookies

tests/asgi/tests.py:84–92  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

82 await communicator.wait()
83
84 async def test_asgi_cookies(self):
85 application = get_asgi_application()
86 scope = self.async_request_factory._base_scope(path="/cookie/")
87 communicator = ApplicationCommunicator(application, scope)
88 await communicator.send_input({"type": "http.request"})
89 response_start = await communicator.receive_output()
90 self.assertIn((b"Set-Cookie", b"key=value; Path=/"), response_start["headers"])
91 # Allow response.close() to finish.
92 await communicator.wait()
93
94 # Python's file API is not async compatible. A third-party library such
95 # as https://github.com/Tinche/aiofiles allows passing the file to

Callers

nothing calls this directly

Calls 2

get_asgi_applicationFunction · 0.90
_base_scopeMethod · 0.80

Tested by

no test coverage detected