Skip to content

Can't get get_fti/get_behaviors to work #32

Description

@ewohnlich

I can't get the get_fti and get_behaviors fixtures to work, the underlying queryUtility returns None. I assume this is actually a problem with setting up the test environment, but I think at the least it should document what you need to do to use these fixtures. This is the most minimalist setup I've used to recreate it:

conftest.py

from Products.CMFPlone.testing import PRODUCTS_CMFPLONE_FUNCTIONAL_TESTING
from Products.CMFPlone.testing import PRODUCTS_CMFPLONE_INTEGRATION_TESTING
from pytest_plone import fixtures_factory


pytest_plugins = ["pytest_plone"]


globals().update(
    fixtures_factory(
        (
            (PRODUCTS_CMFPLONE_FUNCTIONAL_TESTING, "functional"),
            (PRODUCTS_CMFPLONE_INTEGRATION_TESTING, "integration"),
        )
    )
)

test_pytest.py

class TestPytest:
    def test_fti(self, get_fti):
        assert get_fti("Document") is not None

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingquestionFurther information is requested

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions