Beispiel #1
0
 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())
Beispiel #2
0
 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())
Beispiel #3
0
 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())
Beispiel #4
0
 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())
Beispiel #5
0
 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())
Beispiel #6
0
 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)
Beispiel #7
0
 def test_estimator_query_data_blank_dob(self):
     request = self.req_blank
     response = estimator(request, income="40000")
     self.assertTrue(response.status_code == 400)
Beispiel #8
0
 def test_estimator_query_data_blank(self):
     request = self.req_blank
     response = estimator(request)
     self.assertTrue(response.status_code == 400)
Beispiel #9
0
 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)
Beispiel #10
0
 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)
Beispiel #11
0
 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)
Beispiel #12
0
 def test_estimator_query_data_blank_dob(self):
     request = self.req_blank
     response = estimator(request, income='40000')
     self.assertTrue(response.status_code == 400)
Beispiel #13
0
 def test_estimator_query_data_blank(self):
     request = self.req_blank
     response = estimator(request)
     self.assertTrue(response.status_code == 400)
Beispiel #14
0
 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)
Beispiel #15
0
 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)
Beispiel #16
0
 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)
Beispiel #17
0
 def test_estimator_query_data_bad_dob(self):
     request = self.req_invalid
     response = estimator(request, income='40000')
     self.assertTrue(response.status_code == 400)