def test_constructor_body_when_given_str(self): response = Response('Body') self.assertEqual([b'Body'], response.body)
def test_constructor_status(self): response = Response('Body', charset='utf-8') self.assertEqual(response.status_code, 200)
def view_str(name): return Response(f'hello {name}')
def view_int(year: int) -> Response: return Response(f'hello {year}')
def user_detail(user_id: int) -> Response: return Response(f'hello user{user_id}')
def index() -> Response: return Response('hello world')