예제 #1
0
def test_view_template_true():
    configurator = Configurator(
        template="bobtemplates.plone:view",
        target_directory="collective.foo.bar",
        bobconfig={"non_interactive": True},
        variables={
            "view_python_class": True,
            "view_template": True
        },
    )
    view.check_view_template_answer(configurator, None)
예제 #2
0
def test_view_template_and_python_class_false():
    configurator = Configurator(
        template="bobtemplates.plone:view",
        target_directory="collective.foo.bar",
        bobconfig={"non_interactive": True},
        variables={
            "view_python_class": False,
            "view_template": False
        },
    )
    with pytest.raises(ValidationError):
        view.check_view_template_answer(configurator, None)
예제 #3
0
def test_view_template_true():
    configurator = Configurator(
        template='bobtemplates.plone:view',
        target_directory='collective.foo.bar',
        bobconfig={
            'non_interactive': True,
        },
        variables={
            'view_python_class': True,
            'view_template': True,
        },
    )
    view.check_view_template_answer(configurator, None)
예제 #4
0
def test_view_template_and_python_class_false():
    configurator = Configurator(
        template='bobtemplates.plone:view',
        target_directory='collective.foo.bar',
        bobconfig={
            'non_interactive': True,
        },
        variables={
            'view_python_class': False,
            'view_template': False,
        },
    )
    with pytest.raises(ValidationError):
        view.check_view_template_answer(configurator, None)