Skip to content

Commit

Permalink
improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
willemarcel committed Jan 18, 2018
1 parent f72a8b7 commit aad11ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions osmchadjango/changeset/tests/test_comment_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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?'}
Expand Down Expand Up @@ -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(
Expand Down
1 change: 1 addition & 0 deletions osmchadjango/changeset/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit aad11ce

Please sign in to comment.