How to use the premailer.transform.return_value function in premailer

To help you get started, we’ve selected a few premailer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github chris104957 / maildown / tests / test_renderer.py View on Github external
def test_generate_content(monkeypatch):
    monkeypatch.setattr(mistune, "Markdown", mock.MagicMock())
    monkeypatch.setattr(premailer, "transform", mock.MagicMock())
    monkeypatch.setattr(renderer, "HighlightRenderer", mock.MagicMock())
    monkeypatch.setattr(jinja2, "Template", mock.MagicMock())

    renderer.HighlightRenderer.return_value = 1
    premailer.transform.return_value = ""
    jinja2.Template.render.return_value = ""
    renderer.generate_content("")
    mistune.Markdown.assert_called_with(renderer=1)