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)
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)
Exemple #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)
Exemple #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)