Browse Source

Remove assertContains from private thread start api tests

rafalp 6 years ago
parent
commit
592cab01e7
1 changed files with 8 additions and 2 deletions
  1. 8 2
      misago/threads/tests/test_privatethread_start_api.py

+ 8 - 2
misago/threads/tests/test_privatethread_start_api.py

@@ -35,14 +35,20 @@ class StartPrivateThreadTests(AuthenticatedUserTestCase):
         override_acl(self.user, {'can_use_private_threads': 0})
         override_acl(self.user, {'can_use_private_threads': 0})
 
 
         response = self.client.post(self.api_link)
         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):
     def test_cant_start_private_thread(self):
         """permission to start private thread is validated"""
         """permission to start private thread is validated"""
         override_acl(self.user, {'can_start_private_threads': 0})
         override_acl(self.user, {'can_start_private_threads': 0})
 
 
         response = self.client.post(self.api_link)
         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):
     def test_empty_data(self):
         """no data sent handling has no showstoppers"""
         """no data sent handling has no showstoppers"""