def functionality_test_data(dbsession, transact):
    del transact

    from c2cgeoportal_commons.models.main import Functionality

    functionalities = []
    for i in range(0, 4):
        functionality = Functionality(name="functionality_{}".format(i),
                                      value="value_{}".format(i))
        functionality.description = "description_{}".format(i)
        dbsession.add(functionality)
        functionalities.append(functionality)

    dbsession.flush()

    yield {"functionalities": functionalities}
def functionality_test_data(dbsession, transact, settings):
    del transact

    from c2cgeoportal_commons.models.main import Functionality

    functionalities = []
    for i in range(0, 4):
        functionality = Functionality(
            settings["admin_interface"]["available_functionalities"][i]["name"],
            value=f"value_{i}",
        )
        functionality.description = f"description_{i}"
        dbsession.add(functionality)
        functionalities.append(functionality)

    dbsession.flush()

    yield {"functionalities": functionalities}