From aad11ce01c60c5f1999d79cb00e2b1f39eb4ad98 Mon Sep 17 00:00:00 2001 From: Wille Marcel Date: Thu, 18 Jan 2018 18:28:23 -0200 Subject: [PATCH] improve documentation --- osmchadjango/changeset/tests/test_comment_views.py | 4 ++++ osmchadjango/changeset/views.py | 1 + 2 files changed, 5 insertions(+) diff --git a/osmchadjango/changeset/tests/test_comment_views.py b/osmchadjango/changeset/tests/test_comment_views.py index de2dbf4e..7cc63694 100644 --- a/osmchadjango/changeset/tests/test_comment_views.py +++ b/osmchadjango/changeset/tests/test_comment_views.py @@ -98,6 +98,9 @@ def test_comment_good_changeset(self, mock_oauth_client): @override_settings(ENABLE_POST_CHANGESET_COMMENTS=True) @mock.patch.object(oauth.Client, 'request') def test_comment_unreviewed_changeset(self, mock_oauth_client): + """Unreviewed changeset should not receive the #OSMCHA_(GOOD or BAD) + hashtag. + """ mock_oauth_client.return_value = [{'status': '200'}] self.client.login(username=self.user.username, password='password') comment = {'comment': 'Hello! Do you know this area?'} @@ -129,6 +132,7 @@ def test_comment_good_changeset_wrong_data(self): self.assertEqual(response.status_code, 400) def test_comment_changeset_doesnt_exist(self): + """Request should fail if the changeset id is not on our database.""" self.client.login(username=self.user.username, password='password') comment = {'message': 'Hello! Awesome edit'} response = self.client.post( diff --git a/osmchadjango/changeset/views.py b/osmchadjango/changeset/views.py index e02f7278..e43f5fdf 100644 --- a/osmchadjango/changeset/views.py +++ b/osmchadjango/changeset/views.py @@ -525,6 +525,7 @@ def get_queryset(self): class ChangesetCommentAPIView(ModelViewSet): + """Post a comment to a changeset in the OpenStreetMap website.""" queryset = Changeset.objects.all() permission_classes = (IsAuthenticated,) serializer_class = ChangesetCommentSerializer