We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3ac937f commit 863a6f0Copy full SHA for 863a6f0
tests/test_http_asgi.py
@@ -198,7 +198,19 @@ def test_middleware_calls_app(self):
198
test_body = b'Hello world!'
199
app.response_body = test_body
200
app.response_code = 200
201
- req = func.HttpRequest(method='get', url='/test', body=b'')
+ req = self._generate_func_request()
202
+ response = AsgiMiddleware(app).handle(req)
203
+
204
+ # Verify asserted
205
+ self.assertEqual(response.status_code, 200)
206
+ self.assertEqual(response.get_body(), test_body)
207
208
+ def test_middleware_calls_app_http(self):
209
+ app = MockAsgiApplication()
210
+ test_body = b'Hello world!'
211
+ app.response_body = test_body
212
+ app.response_code = 200
213
+ req = self._generate_func_request(url="http://a.b.com")
214
response = AsgiMiddleware(app).handle(req)
215
216
# Verify asserted
0 commit comments