Commit 68f2c1ab authored by Łukasz Nowak's avatar Łukasz Nowak

Assert equality.

It is simpler and produces understandable message in case of error.
parent 87227272
...@@ -161,8 +161,7 @@ class TestInstanceRequest(VifibSlaposRestAPIV1Mixin): ...@@ -161,8 +161,7 @@ class TestInstanceRequest(VifibSlaposRestAPIV1Mixin):
self.assertBasicResponse() self.assertBasicResponse()
self.assertResponseCode(400) self.assertResponseCode(400)
self.assertResponseJson() self.assertResponseJson()
self.assertTrue('error' in self.json_response) self.assertEqual({'error': "Data is not json object."}, self.json_response)
self.assertEqual("Data is not json object.", self.json_response['error'])
self.assertPersonRequestSimulatorEmpty() self.assertPersonRequestSimulatorEmpty()
def test_bad_json(self): def test_bad_json(self):
...@@ -174,8 +173,7 @@ class TestInstanceRequest(VifibSlaposRestAPIV1Mixin): ...@@ -174,8 +173,7 @@ class TestInstanceRequest(VifibSlaposRestAPIV1Mixin):
self.assertBasicResponse() self.assertBasicResponse()
self.assertResponseCode(400) self.assertResponseCode(400)
self.assertResponseJson() self.assertResponseJson()
self.assertTrue('error' in self.json_response) self.assertEqual({'error': "Data is not json object."}, self.json_response)
self.assertEqual("Data is not json object.", self.json_response['error'])
self.assertPersonRequestSimulatorEmpty() self.assertPersonRequestSimulatorEmpty()
def test_empty_json(self): def test_empty_json(self):
...@@ -669,8 +667,7 @@ class TestInstancePOSTbang(VifibSlaposRestAPIV1BangMixin): ...@@ -669,8 +667,7 @@ class TestInstancePOSTbang(VifibSlaposRestAPIV1BangMixin):
self.assertBasicResponse() self.assertBasicResponse()
self.assertResponseCode(400) self.assertResponseCode(400)
self.assertResponseJson() self.assertResponseJson()
self.assertTrue('error' in self.json_response) self.assertEqual({'error': "Data is not json object."}, self.json_response)
self.assertEqual("Data is not json object.", self.json_response['error'])
self.assertInstanceBangSimulatorEmpty() self.assertInstanceBangSimulatorEmpty()
def test_bad_json(self): def test_bad_json(self):
......
25 26
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment