Просмотр исходного кода

Remove assertContains from post read api tests

rafalp 6 лет назад
Родитель
Сommit
b8fe5f3acc
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      misago/threads/tests/test_thread_postread_api.py

+ 4 - 1
misago/threads/tests/test_thread_postread_api.py

@@ -29,7 +29,10 @@ class PostReadApiTests(ThreadsApiTestCase):
         self.logout_user()
 
         response = self.client.post(self.api_link)
-        self.assertContains(response, "This action is not available to guests.", status_code=403)
+        self.assertEqual(response.status_code, 403)
+        self.assertEqual(response.json(), {
+            "detail": "This action is not available to guests."
+        })
 
     def test_read_post(self):
         """api marks post as read"""