Esempio n. 1
0
    def test_jinja_templates_render(self, pyramid_config, pyramid_request):
        """Ensure that the jinja templates don't contain syntax errors"""
        pyramid_config.include('pyramid_jinja2')
        pyramid_config.add_jinja2_extension('h.jinja_extensions.Filters')

        generate(pyramid_request,
                 id=1234,
                 email='*****@*****.**',
                 activation_code='abcd4567')
Esempio n. 2
0
    def test_jinja_templates_render(self, pyramid_config, pyramid_request):
        """Ensure that the jinja templates don't contain syntax errors"""
        pyramid_config.include("pyramid_jinja2")
        pyramid_config.add_jinja2_extension("h.jinja_extensions.Filters")

        generate(
            pyramid_request,
            user_id=1234,
            email="*****@*****.**",
            activation_code="abcd4567",
        )
Esempio n. 3
0
    def test_jinja_templates_render(self, pyramid_config, pyramid_request):
        """Ensure that the jinja templates don't contain syntax errors"""
        pyramid_config.include("pyramid_jinja2")
        pyramid_config.add_jinja2_extension("h.jinja_extensions.Filters")

        generate(
            pyramid_request,
            id=1234,
            email="*****@*****.**",
            activation_code="abcd4567",
        )
Esempio n. 4
0
    def test_calls_renderers_with_appropriate_context(self, pyramid_request,
                                                      html_renderer,
                                                      text_renderer):
        generate(pyramid_request,
                 id=1234,
                 email='*****@*****.**',
                 activation_code='abcd4567')

        expected_context = {
            'activate_link': 'http://example.com/activate/1234/abcd4567',
        }
        html_renderer.assert_(**expected_context)
        text_renderer.assert_(**expected_context)
Esempio n. 5
0
    def test_calls_renderers_with_appropriate_context(self,
                                                      pyramid_request,
                                                      html_renderer,
                                                      text_renderer):
        generate(pyramid_request,
                 id=1234,
                 email='*****@*****.**',
                 activation_code='abcd4567')

        expected_context = {
            'activate_link': 'http://example.com/activate/1234/abcd4567',
        }
        html_renderer.assert_(**expected_context)
        text_renderer.assert_(**expected_context)
Esempio n. 6
0
    def test_calls_renderers_with_appropriate_context(self, pyramid_request,
                                                      html_renderer,
                                                      text_renderer):
        generate(
            pyramid_request,
            user_id=1234,
            email="*****@*****.**",
            activation_code="abcd4567",
        )

        expected_context = {
            "activate_link": "http://example.com/activate/1234/abcd4567"
        }
        html_renderer.assert_(**expected_context)
        text_renderer.assert_(**expected_context)
Esempio n. 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,
                                                   id=1234,
                                                   email='*****@*****.**',
                                                   activation_code='abcd4567')

        assert recipients == ['*****@*****.**']
        assert subject == 'Please activate your account'
        assert html == 'HTML output'
        assert text == 'Text output'
Esempio n. 8
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,
            user_id=1234,
            email="*****@*****.**",
            activation_code="abcd4567",
        )

        assert recipients == ["*****@*****.**"]
        assert subject == "Please activate your account"
        assert html == "HTML output"
        assert text == "Text output"
Esempio n. 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,
                                                   id=1234,
                                                   email='*****@*****.**',
                                                   activation_code='abcd4567')

        assert recipients == ['*****@*****.**']
        assert subject == 'Please activate your account'
        assert html == 'HTML output'
        assert text == 'Text output'
Esempio n. 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,
            id=1234,
            email="*****@*****.**",
            activation_code="abcd4567",
        )

        assert recipients == ["*****@*****.**"]
        assert subject == "Please activate your account"
        assert html == "HTML output"
        assert text == "Text output"