add problem related tests

This commit is contained in:
virusdefender
2017-02-10 15:13:03 +08:00
parent 29aa457a2d
commit f58fd53557
5 changed files with 90 additions and 4 deletions

View File

@@ -32,5 +32,7 @@ class APITestCase(TestCase):
if not response.data["error"] is None:
raise AssertionError("response with errors, response: " + str(response.data))
def assertFailed(self, response):
def assertFailed(self, response, msg=None):
self.assertTrue(response.data["error"] is not None)
if msg:
self.assertEqual(response.data["data"], msg)