vendredi 26 août 2016

Django Identical Testcases. One fails but the other one passes

Here is the code snippet:

def test_get_config_data(self):
    url = self.config_entity_api_uri.format(installation=self.installation, config_id=self.config_id)
    print url
    resp = self.client.get(url)
    self.assertEqual(resp.status_code, 200)

def test_update_config_data(self):
    url = self.config_entity_api_uri.format(installation=self.installation, config_id=self.config_id)
    print url
    resp = self.client.get(url)
    self.assertEqual(resp.status_code, 200)

Output:

in test_update_config_data self.assertEqual(resp.status_code, 200)

AssertionError: 400 != 200

The first testcase passes, printing the data in the response... while the second fails

Aucun commentaire:

Enregistrer un commentaire