Example #1
0
File: base.py Project: cgwire/zou
    def tearDown(self):
        """
        Delete database after each test.
        """
        from zou.app.utils import dbhelpers

        dbhelpers.drop_all()
Example #2
0
    def setUp(self):
        """
        Reset database before each test.
        """
        super(ApiDBTestCase, self).setUp()

        from zou.app.utils import dbhelpers
        dbhelpers.drop_all()
        dbhelpers.create_all()
        self.log_in()
Example #3
0
File: cli.py Project: cgwire/zou
def clear_db():
    "Drop all tables from database"

    from zou.app import app

    with app.app_context():
        import zou

        print("Deleting database and tables...")
        dbhelpers.drop_all()
        print("Database and tables deleted.")

        directory = os.path.join(os.path.dirname(zou.__file__), "migrations")
        flask_migrate.stamp(directory=directory, revision="base")
Example #4
0
def clear_db():
    "Drop all tables from database"

    print("Deleting database and tables...")
    dbhelpers.drop_all()
    print("Database and tables deleted.")