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)
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)
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)