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