示例#1
0
文件: suite.py 项目: sliuqin/yuan
    def setUp(self):
        config = {'TESTING': True}
        config['SECRET_KEY'] = 'secret-key-for-test'

        self.db_fd, self.db_file = tempfile.mkstemp()
        config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///%s' % self.db_file

        app = create_app(config)
        self.app = app

        self.client = app.test_client()

        db.create_all()

        if hasattr(self, 'prehook'):
            self.prehook()
示例#2
0
    def setUp(self):
        config = {'TESTING': True}
        config['SECRET_KEY'] = 'secret-key-for-test'
        config['WWW_ROOT'] = 'tests/data'

        self.db_fd, self.db_file = tempfile.mkstemp()
        config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///%s' % self.db_file

        app = create_app(config)
        self.app = app

        self.client = app.test_client()

        db.create_all()

        if hasattr(self, 'prehook'):
            self.prehook()
示例#3
0
文件: manager.py 项目: souse/yuan
def createdb():
    """Create a database."""
    from yuan.models import db
    db.create_all()