def test_index(): # check that we get a 404 on the / URL resp = app.request("/") assert_response(resp, status="404") # test our first GET request to/hello resp = app.request("/hello") assert_response(resp) # make sure default values will work for the form resp = app.request("/hello", method="POST") assert_response(resp, contains="NOBODY") # test that we get expected values data = {'name': 'Zahid', 'greet': 'hello'} resp = app.request('/hello', method="POST", data=data) assert_response(resp, contains="Zahid")
def test_index(): #check that we got a 404 on the / URL resp = app.request("/") assert_response(resp, status="404") #test our first GET requst to /hello resp = app.request("/hello") assert_response(resp) #make sure default values work for theform resp = app.request("/hello", method="POST") assert_response(resp, contains="Nobody") #test that we got expected values data = {'name': 'Zed', 'greet': 'Hola'} resp = app.request("/hello", method="POST", data=data) assert_response(resp, contains="Zed")
def test_index(): # check that we get a 404 on the / URL resp = app.request("/") assert_response(resp, status="404") # test our first GET request to /hello resp = app.request("/hello") assert_response(resp) # make sure default values work for the form resp = app.request("/hello", method='POST') assert_response(resp, contains="Nobody") # test that we get expected values data = {'name': 'Zed', 'greet': 'Hola'} resp = app.request("/hello", method='POST', data=data) assert_response(resp, contains="Zed")
def test_index(): # check that we get a 303 on the / URL resp = app.request("/") assert_response(resp, status="303") # test our first GET request to /game resp = app.request("/game") assert_response(resp) # test that we POST request to /game data = {'action': 'tell a joke'} resp = app.request("/game", method='POST', data=data) assert_response(resp, status='303')
def test_SayHello(): # test our first GET request to /hello resp = app.request("/hello") assert_response(resp) # make sure default values work for the form resp = app.request("/hello", method="POST") assert_response(resp, contains="Nobody") # test that we get expected values data = {'name': 'Zed', 'greet': 'Hola'} resp = app.request("/hello", method="POST", data=data) assert_response(resp, contains="Zed")
def test_Index(): # check that we get a 404 on the / URL resp = app.request("/") assert_response(resp)