예제 #1
0
    def test_calls_renderers_with_appropriate_context(self, pyramid_request,
                                                      html_renderer,
                                                      text_renderer):
        generate(pyramid_request,
                 email='*****@*****.**',
                 incontext_link='http://hyp.is/a/ann1')

        expected_context = {
            'incontext_link': 'http://hyp.is/a/ann1',
        }
        html_renderer.assert_(**expected_context)
        text_renderer.assert_(**expected_context)
예제 #2
0
    def test_calls_renderers_with_appropriate_context(
        self, pyramid_request, html_renderer, text_renderer
    ):
        generate(
            pyramid_request,
            email="*****@*****.**",
            incontext_link="http://hyp.is/a/ann1",
        )

        expected_context = {"incontext_link": "http://hyp.is/a/ann1"}
        html_renderer.assert_(**expected_context)
        text_renderer.assert_(**expected_context)
예제 #3
0
    def test_calls_renderers_with_appropriate_context(self,
                                                      pyramid_request,
                                                      html_renderer,
                                                      text_renderer):
        generate(pyramid_request,
                 email='*****@*****.**',
                 incontext_link='http://hyp.is/a/ann1')

        expected_context = {
            'incontext_link': 'http://hyp.is/a/ann1',
        }
        html_renderer.assert_(**expected_context)
        text_renderer.assert_(**expected_context)
예제 #4
0
파일: flags.py 프로젝트: sk8terboi87/h
def _email_group_admin(request, annotation):
    group_service = request.find_service(IGroupService)
    group = group_service.find(annotation.groupid)

    incontext_link = links.incontext_link(request, annotation)
    if incontext_link is None:
        incontext_link = annotation.target_uri

    if group.creator is not None:
        send_params = flag_notification.generate(request, group.creator.email, incontext_link)
        mailer.send.delay(*send_params)
예제 #5
0
파일: api_flags.py 프로젝트: gnott/h
def _email_group_admin(request, annotation):
    group_service = request.find_service(IGroupService)
    group = group_service.find(annotation.groupid)

    incontext_link = links.incontext_link(request, annotation)
    if incontext_link is None:
        incontext_link = annotation.target_uri

    if group.creator is not None:
        send_params = flag_notification.generate(request, group.creator.email, incontext_link)
        mailer.send.delay(*send_params)
예제 #6
0
def _email_group_admin(request, annotation):
    incontext_link = links.incontext_link(request, annotation)
    if incontext_link is None:
        incontext_link = annotation.target_uri

    group = annotation.group
    if group.creator and group.creator.email:
        send_params = flag_notification.generate(
            request, group.creator.email, incontext_link
        )
        mailer.send.delay(*send_params)
예제 #7
0
    def test_appropriate_return_values(self, pyramid_request, html_renderer,
                                       text_renderer):
        html_renderer.string_response = 'HTML output'
        text_renderer.string_response = 'Text output'

        recipients, subject, text, html = generate(
            pyramid_request,
            email='*****@*****.**',
            incontext_link='http://hyp.is/a/ann1')

        assert recipients == ['*****@*****.**']
        assert subject == 'An annotation has been flagged'
        assert html == 'HTML output'
        assert text == 'Text output'
    def test_appropriate_return_values(self, pyramid_request, html_renderer,
                                       text_renderer):
        html_renderer.string_response = "HTML output"
        text_renderer.string_response = "Text output"

        recipients, subject, text, html = generate(
            pyramid_request,
            email="*****@*****.**",
            incontext_link="http://hyp.is/a/ann1",
        )

        assert recipients == ["*****@*****.**"]
        assert subject == "An annotation has been flagged"
        assert html == "HTML output"
        assert text == "Text output"
예제 #9
0
    def test_appropriate_return_values(self,
                                       pyramid_request,
                                       html_renderer,
                                       text_renderer):
        html_renderer.string_response = 'HTML output'
        text_renderer.string_response = 'Text output'

        recipients, subject, text, html = generate(pyramid_request,
                                                   email='*****@*****.**',
                                                   incontext_link='http://hyp.is/a/ann1')

        assert recipients == ['*****@*****.**']
        assert subject == 'An annotation has been flagged'
        assert html == 'HTML output'
        assert text == 'Text output'
예제 #10
0
    def test_appropriate_return_values(
        self, pyramid_request, html_renderer, text_renderer
    ):
        html_renderer.string_response = "HTML output"
        text_renderer.string_response = "Text output"

        recipients, subject, text, html = generate(
            pyramid_request,
            email="*****@*****.**",
            incontext_link="http://hyp.is/a/ann1",
        )

        assert recipients == ["*****@*****.**"]
        assert subject == "An annotation has been flagged"
        assert html == "HTML output"
        assert text == "Text output"