예제 #1
0
 def resetDB(self):
     self.db.session.remove()
     self.db.drop_all()
     
     models.create_tables(self.app)
     fixtures.install(self.app, *fixtures.all_data)
     self.db = models.init_app(self.app)
예제 #2
0
def resetdb():
    """Drops all tables and recreates them from scratch including fixtures."""
    if not (app.debug or app.config['TESTING']):
        print "Application is not in debug mode!"
    else:
        db.drop_all()
        db.create_all()
        fixtures.install(db.session, *fixtures.all_data)
        db.session.commit()
예제 #3
0
    def setUp(self):
        super(DatabaseMixin, self).setUp()
        db.init_app(self.app)

        db.drop_all()
        db.create_all()

        fixtures.install(db.session, *fixtures.all_data)
        db.session.flush()
예제 #4
0
def resetdb():
    """Drops all tables and recreates them from scratch including fixtures."""
    if not (app.debug or app.config['TESTING']):
        print "Application is not in debug mode!"
    else:
        db.drop_all()
        db.create_all()
        fixtures.install(db.session, *fixtures.all_data)
        db.session.commit()
예제 #5
0
    def setUp(self):
        super(DatabaseMixin, self).setUp()
        db.init_app(self.app)

        db.drop_all()
        db.create_all()

        fixtures.install(db.session, *fixtures.all_data)
        db.session.flush()
예제 #6
0
 def setUpClass(self):
     models.create_tables(self.app)
     fixtures.install(self.app, *fixtures.all_data)
     self.db = models.init_app(self.app)
예제 #7
0
 def setUp(self):
     self.db.create_all()
     fixtures.install(self.app, *fixtures.all_data)
     identity_changed.send(current_app._get_current_object(),
                           identity=Identity(1))
     self.user = models.SyncUser.query.filter_by(id=1).first()
예제 #8
0
파일: test.py 프로젝트: Tutorspree/minisync
 def setUp(self):
     self.db.create_all()
     fixtures.install(self.app, *fixtures.all_data)
     identity_changed.send(current_app._get_current_object(), identity=Identity(1))
     self.user = models.SyncUser.query.filter_by(id=1).first()
예제 #9
0
 def setUpClass(self):
     models.create_tables(self.app)
     fixtures.install(self.app, *fixtures.organization_test_data)
     self.db = models.init_app(self.app)