def setUpClass(cls): """ This runs once before the entire test suite """ app.config['TESTING'] = True app.config['DEBUG'] = False app.config["SQLALCHEMY_DATABASE_URI"] = DATABASE_URI app.logger.setLevel(logging.CRITICAL) Promotion.init_db(app) pass
def setUp(self): """ Initialize the Cloudant database """ self.app = app.test_client() Promotion.init_db("tests") Promotion.remove_all() Promotion("A001", "BOGO", True, 10).save() Promotion("A002", "B2GO", True, 10).save() Promotion("A003", "B3GO", False, 10).save()
def setUpClass(cls): """ This runs once before the entire test suite """ global DATABASE_URI app.config['TESTING'] = True app.config['DEBUG'] = False if 'VCAP_SERVICES' in os.environ: vcap = json.loads(os.environ['VCAP_SERVICES']) DATABASE_URI = vcap['user-provided'][0]['credentials']['url'] app.config["SQLALCHEMY_DATABASE_URI"] = DATABASE_URI app.logger.setLevel(logging.CRITICAL) Promotion.init_db(app)
def setUp(self): """ Initialize the Cloudant database """ Promotion.init_db("test") Promotion.remove_all()
def init_db(): """ Initialies the SQLAlchemy app """ global app Promotion.init_db(app)
def setUp(self): """ Runs before each test """ Promotion.init_db("test") Promotion.remove_all()
def setUpClass(cls): app.config['TESTING'] = True app.config['DEBUG'] = False app.config["SQLALCHEMY_DATABASE_URI"] = DATABASE_URI app.logger.setLevel(logging.CRITICAL) Promotion.init_db(app)
def setUp(self): """ Runs before each test """ Promotion.init_db("test") Promotion.remove_all() self.app = app.test_client()