def test_post_body_markdown_render(): body = textwrap.dedent("""\ Start of the body * Bullet 1 * [Bullet 2](http://example.com) """) new_post = Post(title="Foo", body=body) assert "<ul>" in new_post.body_as_html() assert "<a href=" in new_post.body_as_html()
def test_post_body_render_should_work_with_empty_body(): empty_body_post = Post(title="No body", body=None) assert empty_body_post.body_as_html() is None