()
| 41 | |
| 42 | |
| 43 | async def test_render_unsupported_method() -> None: |
| 44 | class MyView(View): |
| 45 | async def get(self): |
| 46 | return web.Response(text="OK") |
| 47 | |
| 48 | options = delete = get |
| 49 | |
| 50 | request = mock.Mock() |
| 51 | request.method = "POST" |
| 52 | with pytest.raises(web.HTTPMethodNotAllowed) as ctx: |
| 53 | await MyView(request) |
| 54 | assert ctx.value.headers["allow"] == "DELETE,GET,OPTIONS" |
| 55 | assert ctx.value.status == 405 |