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')
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", )
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", )
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)
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)
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'
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"
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"