def test_it_returns_presented_annotation(self, presentation_service, pyramid_request): context = mock.Mock() result = views.read(context, pyramid_request) presentation_service.present.assert_called_once_with(context) assert result == presentation_service.present.return_value
def test_it_returns_presented_annotation(self, AnnotationJSONPresenter, pyramid_request): context = mock.Mock() presenter = mock.Mock() AnnotationJSONPresenter.return_value = presenter result = views.read(context, pyramid_request) AnnotationJSONPresenter.assert_called_once_with(context) assert result == presenter.asdict()