|
@@ -35,14 +35,20 @@ class StartPrivateThreadTests(AuthenticatedUserTestCase):
|
|
|
override_acl(self.user, {'can_use_private_threads': 0})
|
|
|
|
|
|
response = self.client.post(self.api_link)
|
|
|
- self.assertContains(response, "You can't use private threads.", status_code=403)
|
|
|
+ self.assertEqual(response.status_code, 403)
|
|
|
+ self.assertEqual(response.json(), {
|
|
|
+ "detail": "You can't use private threads.",
|
|
|
+ })
|
|
|
|
|
|
def test_cant_start_private_thread(self):
|
|
|
"""permission to start private thread is validated"""
|
|
|
override_acl(self.user, {'can_start_private_threads': 0})
|
|
|
|
|
|
response = self.client.post(self.api_link)
|
|
|
- self.assertContains(response, "You can't start private threads.", status_code=403)
|
|
|
+ self.assertEqual(response.status_code, 403)
|
|
|
+ self.assertEqual(response.json(), {
|
|
|
+ "detail": "You can't start private threads.",
|
|
|
+ })
|
|
|
|
|
|
def test_empty_data(self):
|
|
|
"""no data sent handling has no showstoppers"""
|