示例#1
0
    def setUp(self):
        testfile = "/tmp/vacation_test.db"
        if os.path.exists(testfile):
            os.remove(testfile)
        # important: 4 slashes for absolute paths!
        testdb = "sqlite:///%s" % testfile

        config = RawConfigParser()
        config.add_section('VacationPlugin')
        config.set('VacationPlugin', 'dbconnectstring', testdb)
        self.config = config
        self.candidate = VacationPlugin(config)

        self.session = fuglu.extensions.sql.get_session(testdb)
        bind = self.session.get_bind(Vacation)
        self.create_database(bind)