コード例 #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()