Exemplo n.º 1
0
def test_find_all_widgets_in_community():
    with open("tests/legacy/test_data/community_1.json") as fh:
        community = json.load(fh)
    assert community
    widgets = find_all_widgets(community, widgetType="html")
    assert len(widgets) == 0
    widgets = find_all_widgets(community, widgetType="meta-social")
    assert len(widgets) == 5
Exemplo n.º 2
0
def test_find_all_widgets_in_template():
    with open("tests/legacy/test_data/template_1.json") as fh:
        template = json.load(fh)
    assert template
    widgets = find_all_widgets(template, widgetType="html")
    assert len(widgets) == 2
Exemplo n.º 3
0
def test_find_all_widgets_in_content():
    with open("tests/legacy/test_data/content_1.json") as fh:
        content = json.load(fh)
    assert content
    widgets = find_all_widgets(content, widgetType="html")
    assert len(widgets) == 1