コード例 #1
0
    def setUp(self):
        db.create_all()
        self.roles = self._create_default_roles()
        self.student_role = self.roles[0]
        self.admin_role = self.roles[1]
        self.foo_role = self.roles[2]

        self.student_user = self._create_user(username='******', phone='+12223334444', role=self.student_role)
        self.admin_user = self._create_user(username='******', phone='+13334445555', role=self.admin_role)
        self.foo_user = self._create_user(username='******', phone='+14445556666', role=self.foo_role)
        self.student_user2 = self._create_user(username='******', phone='+15556667777', role=self.student_role)

        self.users = [self.student_user, self.admin_user, self.foo_user]
コード例 #2
0
    def setUp(self):
        db.create_all()
        self.roles = self._create_default_roles()
        self.student_role = self.roles[0]
        self.admin_role = self.roles[1]
        self.foo_role = self.roles[2]

        self.student_user = self._create_user(username='******',
                                              phone='+12223334444',
                                              role=self.student_role)
        self.admin_user = self._create_user(username='******',
                                            phone='+13334445555',
                                            role=self.admin_role)
        self.foo_user = self._create_user(username='******',
                                          phone='+14445556666',
                                          role=self.foo_role)
        self.student_user2 = self._create_user(username='******',
                                               phone='+15556667777',
                                               role=self.student_role)

        self.users = [self.student_user, self.admin_user, self.foo_user]
コード例 #3
0
from steerclear import db

if __name__ == "__main__":
    db.drop_all()
    db.create_all()
コード例 #4
0
import sys, os

# change path to parent directory to import modules
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

from steerclear import db
from steerclear.models import Role

if __name__ == "__main__":

    db.drop_all()
    db.create_all()

    student_role = Role(name='student', description='Student Role')
    admin_role = Role(name='admin', description='Admin Role')
    db.session.add_all([student_role, admin_role])
    db.session.commit()
コード例 #5
0
 def setUp(self):
     app.config['TESTING'] = True
     app.config['SQLALCHEMY_DATABASE_URI'] = app.config['TEST_SQLALCHEMY_DATABASE_URI']
     self.client = app.test_client()
     db.create_all()