|
@@ -27,13 +27,13 @@ class ParseMarkupApiTests(AuthenticatedUserTestCase):
|
|
def test_invalid_data(self):
|
|
def test_invalid_data(self):
|
|
"""api handles post that is invalid type"""
|
|
"""api handles post that is invalid type"""
|
|
response = self.client.post(self.api_link, '[]', content_type="application/json")
|
|
response = self.client.post(self.api_link, '[]', content_type="application/json")
|
|
- self.assertContains(response, "Invalid data. Expected a dictionary, but got list.", status_code=400)
|
|
|
|
|
|
+ self.assertContains(response, "Invalid data. Expected a dictionary", status_code=400)
|
|
|
|
|
|
response = self.client.post(self.api_link, '123', content_type="application/json")
|
|
response = self.client.post(self.api_link, '123', content_type="application/json")
|
|
- self.assertContains(response, "Invalid data. Expected a dictionary, but got int.", status_code=400)
|
|
|
|
|
|
+ self.assertContains(response, "Invalid data. Expected a dictionary", status_code=400)
|
|
|
|
|
|
response = self.client.post(self.api_link, '"string"', content_type="application/json")
|
|
response = self.client.post(self.api_link, '"string"', content_type="application/json")
|
|
- self.assertContains(response, "Invalid data. Expected a dictionary, but got unicode.", status_code=400)
|
|
|
|
|
|
+ self.assertContains(response, "Invalid data. Expected a dictionary", status_code=400)
|
|
|
|
|
|
response = self.client.post(self.api_link, 'malformed', content_type="application/json")
|
|
response = self.client.post(self.api_link, 'malformed', content_type="application/json")
|
|
self.assertContains(response, "JSON parse error - No JSON object could be decoded", status_code=400)
|
|
self.assertContains(response, "JSON parse error - No JSON object could be decoded", status_code=400)
|