Пример #1
0
 class WebApiClientTest(WebTest):
     setup_auth = False
     fixtures = ['test_data.json']
     
     def setUp(self):
         self.web_api_client = WebApiClient()
     
     def test_query_filter_ok(self):
         result = self.web_api_client.query_filter(app_label='web_api', model_name='WebApiTestItem', filter_dict={"pk": 1})
         self.assertEqual(result['STATUS'], 'OK')
         
     def test_query_filter_error(self):
         result = self.web_api_client.query_filter(app_label='web_api', model_name='WebApiTestItem2', filter_dict={"pk": random.randrange(100000, 999999)})
         self.assertEqual(result.has_key('ERROR'), True)
Пример #2
0
 def setUp(self):
     self.web_api_client = WebApiClient()