Example #1
0
    def setUp(self, env='test'):
        self.app = create_app(env)

        # Allow overriding of database URI from the environment.
        db_uri_override = os.environ.get('DATABASE_URI')
        if db_uri_override:
            self.app.config['SQLALCHEMY_DATABASE_URI'] = db_uri_override

        self.db = db
        db.app = self.app

        db.reflect()
        db.drop_all()
        db.create_all()

        self.create_brand_and_party()
        self.create_admin()
Example #2
0
    def setUp(self, config_filename=CONFIG_FILENAME_TEST):
        self.app = create_app(config_filename)

        # Allow overriding of database URI from the environment.
        db_uri_override = os.environ.get('DATABASE_URI')
        if db_uri_override:
            self.app.config['SQLALCHEMY_DATABASE_URI'] = db_uri_override

        self.db = db
        db.app = self.app

        db.reflect()
        db.drop_all()
        db.create_all()

        self.create_brand_and_party()
        self.create_admin()
Example #3
0
def execute():
    click.echo('Creating database tables ... ', nl=False)

    db.create_all()

    click.secho('done.', fg='green')