コード例 #1
0
ファイル: moderation_test.py プロジェクト: chinmaygghag/h
    def test_it_publishes_update_event(self, pyramid_request, resource, events):
        views.create(resource, pyramid_request)

        events.AnnotationEvent.assert_called_once_with(
            pyramid_request, resource.annotation.id, 'update')

        pyramid_request.notify_after_commit.assert_called_once_with(
            events.AnnotationEvent.return_value)
コード例 #2
0
 def test_it_renders_no_content(self, pyramid_request, resource):
     response = views.create(resource, pyramid_request)
     assert isinstance(response, HTTPNoContent)
コード例 #3
0
    def test_it_hides_the_annotation(self, pyramid_request, resource,
                                     moderation_service):
        views.create(resource, pyramid_request)

        moderation_service.hide.assert_called_once_with(resource.annotation)
コード例 #4
0
ファイル: moderation_test.py プロジェクト: hypothesis/h
 def test_it_renders_no_content(self, pyramid_request, resource):
     response = views.create(resource, pyramid_request)
     assert isinstance(response, HTTPNoContent)
コード例 #5
0
ファイル: moderation_test.py プロジェクト: hypothesis/h
    def test_it_hides_the_annotation(
        self, pyramid_request, resource, moderation_service
    ):
        views.create(resource, pyramid_request)

        moderation_service.hide.assert_called_once_with(resource.annotation)
コード例 #6
0
ファイル: moderation_test.py プロジェクト: yumatch/h
 def test_it_responds_with_not_found_when_no_admin_access_in_group(self, pyramid_request, resource):
     pyramid_request.has_permission.return_value = False
     with pytest.raises(HTTPNotFound):
         views.create(resource, pyramid_request)
コード例 #7
0
ファイル: moderation_test.py プロジェクト: yumatch/h
 def test_it_checks_for_group_admin_permission(self, pyramid_request, resource):
     views.create(resource, pyramid_request)
     pyramid_request.has_permission.assert_called_once_with('admin', resource.group)