Browse Source

Replace last assertContains with assertEqual in pollvotes api test

Rafał Pitoń 7 years ago
parent
commit
fb12752206
1 changed files with 4 additions and 1 deletions
  1. 4 1
      misago/threads/tests/test_thread_pollvotes_api.py

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

@@ -346,7 +346,10 @@ class ThreadPostVotesTests(ThreadPollApiTestCase):
         self.delete_user_votes()
 
         response = self.post(self.api_link, data=['lorem', 'ipsum'])
-        self.assertContains(response, "One or more of poll choices were invalid.", status_code=400)
+        self.assertEqual(response.status_code, 400)
+        self.assertEqual(response.json(), {
+            'choices': ["One or more of poll choices were invalid."],
+        })
 
     def test_too_many_choices(self):
         """api validates if vote that user has made overlaps with allowed votes"""