Example #1
0
    def begin(self):
        """We overwrite this method to push in our database
        setup and to not setup coverage again, since we start it
        quite a lot earlier.
        """
        engine = db.get_engine()

        # cleanup the existing databases and recreate them.
        # Also ensure that a database exists properly.
        destroy_db(engine)
        create_db(engine)

        # create a connection to the existing database
        self._connection = connection = engine.connect()

        # setup all database tables.
        database.init_db(bind=connection, is_test=True)

        # clear email outbox
        mail.outbox = []

        _internal_modules_to_skip = ('inyoka.core.tasks', )
        self.skipModules = [
            i for i in sys.modules.keys()
            if not i.startswith('inyoka') or i in _internal_modules_to_skip
        ]
Example #2
0
    def begin(self):
        """We overwrite this method to push in our database
        setup and to not setup coverage again, since we start it
        quite a lot earlier.
        """
        engine = db.get_engine()

        # cleanup the existing databases and recreate them.
        # Also ensure that a database exists properly.
        destroy_db(engine)
        create_db(engine)

        # create a connection to the existing database
        self._connection = connection = engine.connect()

        # setup all database tables.
        database.init_db(bind=connection, is_test=True)

        # clear email outbox
        mail.outbox = []

        _internal_modules_to_skip = ('inyoka.core.tasks',)
        self.skipModules = [i for i in sys.modules.keys() if not i.startswith('inyoka')
                            or i in _internal_modules_to_skip]
Example #3
0
def initdb():
    """Initialize the database"""
    dispatcher = _make_app()
    from inyoka.core.database import init_db, get_engine
    init_db(bind=get_engine())
Example #4
0
def initdb():
    """Initialize the database"""
    dispatcher = _make_app()
    from inyoka.core.database import init_db, get_engine
    init_db(bind=get_engine())