tori.db.fixture

Warning

This feature is added in 2.1 but neither tested nor supported in 2.1.

Author:Juti Noppornpitak
class tori.db.fixture.Fixture(repository)

Foundation of the council

Note

this must be used at most once.

Warning

this class is not tested.

set(kind, fixtures)

Define the fixtures.

Parameters:
  • kind (unicode|str) – a string represent the kind
  • fixtures (dict) – the data dictionary keyed by the alias
fixture = Fixture()

fixture.set(
    'council.security.model.Provider',
    {
        'ldap': { 'name': 'ldap' }
    }
)
fixture.set(
    'council.user.model.User', {
        'admin': { 'name': 'Juti Noppornpitak' }
    }
)
fixture.set(
    'council.security.model.Credential',
    {
        'shiroyuki': {
            'login':    'admin',
            'user':     'proxy/council.user.model.User/admin',
            'provider': 'proxy/council.security.model.Provider/ldap'
        }
    }
)