Ejemplo n.º 1
0
 def test_argument_does_not_belong_to_issue(self):
     request = construct_dummy_request(
         matchdict={
             'slug': self.issue_cat_or_dog.slug,
             'argument_id': self.argument_town.uid
         })
     response = apiviews.discussion_finish(request)
     self.assertIsInstance(response, httpexceptions.HTTPError)
     self.assertEqual(response.status_code, 400)
Ejemplo n.º 2
0
 def test_issue_is_disabled(self):
     request = construct_dummy_request(
         matchdict={
             'slug': self.issue_disabled.slug,
             'argument_id': self.argument_town.uid
         })
     response: Response = apiviews.discussion_finish(request)
     self.assertIsInstance(response, httpexceptions.HTTPError)
     self.assertEqual(response.status_code, 410)
Ejemplo n.º 3
0
 def test_valid_slug_and_issue_returns_bubbles(self):
     request = construct_dummy_request(
         matchdict={
             'slug': self.issue_cat_or_dog.slug,
             'argument_id': self.argument_cat_or_dog.uid
         })
     response = apiviews.discussion_finish(request)
     self.assertIsInstance(response, dict)
     self.assertIn('bubbles', response)