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') generate(pyramid_request, '*****@*****.**')
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') generate(pyramid_request, '*****@*****.**')
def test_calls_renderers_with_appropriate_context(self, pyramid_request, html_renderer, text_renderer): generate(pyramid_request, "*****@*****.**") expected_context = { "time": Any.string(), "hostname": Any.string(), "python_version": Any.string(), "version": __version__, } html_renderer.assert_(**expected_context) text_renderer.assert_(**expected_context)
def test_calls_renderers_with_appropriate_context(self, pyramid_request, html_renderer, text_renderer, matchers): generate(pyramid_request, '*****@*****.**') expected_context = { 'time': matchers.InstanceOf(string_types), 'hostname': matchers.InstanceOf(string_types), 'python_version': matchers.InstanceOf(string_types), 'version': __version__, } html_renderer.assert_(**expected_context) text_renderer.assert_(**expected_context)
def test_calls_renderers_with_appropriate_context( self, pyramid_request, html_renderer, text_renderer, matchers ): generate(pyramid_request, "*****@*****.**") expected_context = { "time": matchers.InstanceOf(string_types), "hostname": matchers.InstanceOf(string_types), "python_version": matchers.InstanceOf(string_types), "version": __version__, } html_renderer.assert_(**expected_context) text_renderer.assert_(**expected_context)
def test_calls_renderers_with_appropriate_context(self, pyramid_request, html_renderer, text_renderer, matchers): generate(pyramid_request, '*****@*****.**') expected_context = { 'time': matchers.instance_of(string_types), 'hostname': matchers.instance_of(string_types), 'python_version': matchers.instance_of(string_types), 'version': __version__, } html_renderer.assert_(**expected_context) text_renderer.assert_(**expected_context)
def mailer_test(request): """Send a test email.""" if "recipient" not in request.params: index = request.route_path("admin.mailer") return HTTPSeeOther(location=index) mail = test.generate(request, request.params["recipient"]) result = mailer.send.delay(*mail) index = request.route_path("admin.mailer", _query={"taskid": result.task_id}) return HTTPSeeOther(location=index)
def mailer_test(request): """Send a test email.""" if "recipient" not in request.params: index = request.route_path("admin.mailer") return HTTPSeeOther(location=index) mail = test.generate(request, request.params["recipient"]) result = mailer.send.delay(*mail) index = request.route_path("admin.mailer", _query={"taskid": result.task_id}) return HTTPSeeOther(location=index)
def mailer_test(request): """Send a test email.""" if 'recipient' not in request.params: index = request.route_path('admin.mailer') return HTTPSeeOther(location=index) mail = test.generate(request, request.params['recipient']) result = mailer.send.delay(*mail) index = request.route_path('admin.mailer', _query={'taskid': result.task_id}) return HTTPSeeOther(location=index)
def mailer_test(request): """Send a test email.""" if 'recipient' not in request.params: index = request.route_path('admin_mailer') return HTTPSeeOther(location=index) mail = test.generate(request, request.params['recipient']) result = mailer.send.delay(*mail) index = request.route_path('admin_mailer', _query={'taskid': result.task_id}) return HTTPSeeOther(location=index)
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, "*****@*****.**") assert recipients == ["*****@*****.**"] assert subject == "Test mail" 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, '*****@*****.**') assert recipients == ['*****@*****.**'] assert subject == 'Test mail' 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, '*****@*****.**') assert recipients == ['*****@*****.**'] assert subject == 'Test mail' 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, "*****@*****.**" ) assert recipients == ["*****@*****.**"] assert subject == "Test mail" assert html == "HTML output" assert text == "Text output"