def test_estimator_url_data(self): request = self.req_blank response = estimator(request, dob="1955-05-05", income="40000") self.assertIsInstance(response.content, bytes) rdata = json.loads(response.content) for each in self.return_keys: self.assertTrue(each in rdata.keys())
def test_estimator_url_data(self): request = self.req_blank response = estimator(request, dob="1955-05-05", income="40000") self.assertTrue(type(response.content) == str) rdata = json.loads(response.content) for each in self.return_keys: self.assertTrue(each in rdata.keys())
def test_estimator_url_data(self): request = self.req_blank response = estimator(request, dob='1955-05-05', income='40000') self.assertTrue(type(response.content) == str) rdata = json.loads(response.content) for each in self.return_keys: self.assertTrue(each in rdata.keys())
def test_estimator_query_data(self): request = self.req_good response = estimator(request) self.assertTrue(response.status_code == 200) self.assertTrue(type(response.content) == str) rdata = json.loads(response.content) for each in self.return_keys: self.assertTrue(each in rdata.keys())
def test_estimator_query_data_bad_income(self): request = self.req_invalid response = estimator(request, dob="1955-05-05") self.assertTrue(response.status_code == 400)
def test_estimator_query_data_blank_dob(self): request = self.req_blank response = estimator(request, income="40000") self.assertTrue(response.status_code == 400)
def test_estimator_query_data_blank(self): request = self.req_blank response = estimator(request) self.assertTrue(response.status_code == 400)
def test_estimator_url_data_bad_dob(self): request = self.req_blank response = estimator(request, dob='1955-05-xx', income='4000') self.assertTrue(response.status_code == 400)
def test_estimator_query_data_bad_dob_of_today(self): request = self.req_blank response = estimator(request, income='40000', dob="%s" % today) self.assertTrue(response.status_code == 400)
def test_estimator_query_data_bad_income(self): request = self.req_invalid response = estimator(request, dob='1955-05-05') self.assertTrue(response.status_code == 400)
def test_estimator_query_data_blank_dob(self): request = self.req_blank response = estimator(request, income='40000') self.assertTrue(response.status_code == 400)
def test_estimator_url_data_bad_income(self): request = self.req_blank response = estimator(request, dob="1955-05-05", income="z") self.assertTrue(response.status_code == 400)
def test_estimator_url_data_bad_income(self): request = self.req_blank response = estimator(request, dob='1955-05-05', income='z') self.assertTrue(response.status_code == 400)
def test_estimator_url_data_bad_dob(self): request = self.req_blank response = estimator(request, dob="1955-05-xx", income="4000") self.assertTrue(response.status_code == 400)
def test_estimator_query_data_bad_dob(self): request = self.req_invalid response = estimator(request, income='40000') self.assertTrue(response.status_code == 400)