Beispiel #1
0
def test_content_block_template(rf):
    TEMPLATES = get_templates_setting_for_specific_directories(settings.TEMPLATES, [TEMPLATES_DIR])
    with override_settings(TEMPLATES=TEMPLATES):
        request = rf.get("/")
        dcb = DashboardContentBlock.by_rendering_template("foo", request, "module_template.jinja", {
            "name": "world"
        })
        assert dcb.content == "Hello world"
Beispiel #2
0
def test_content_block_template(rf):
    TEMPLATES = get_templates_setting_for_specific_directories(
        settings.TEMPLATES, [TEMPLATES_DIR])
    with override_settings(TEMPLATES=TEMPLATES):
        request = rf.get("/")
        dcb = DashboardContentBlock.by_rendering_template(
            "foo", request, "module_template.jinja", {"name": "world"})
        assert dcb.content == "Hello world"