def setUp(self): check_db = re.search('_test', config.MONGO_DATABASE) if not check_db: test_db = '%s_test' % config.MONGO_DATABASE else: test_db = config.MONGO_DATABASE self.cap, self.db = create_app(test_db) self.app = self.cap.test_client() self.app.get('/')
def setUp(self): check_db = re.search('_test', config.MONGO_DATABASE) if not check_db: test_db = '%s_test' % config.MONGO_DATABASE else: test_db = config.MONGO_DATABASE self.cap, self.db = setup_application.create_app(test_db) self.app = self.cap.test_client() self.app.get('/')
def setUp(self): self.app, self.db = setup_application.create_app('True') self.app_context = self.app.app_context() self.app_context.push() self.client = self.app.test_client() self.client.get('/') self.tasks = cap.tasks if not re.search('_test', self.tasks.config.MONGO_DATABASE): self.tasks.config.MONGO_DATABASE = ( '%s_test' % self.tasks.config.MONGO_DATABASE ) self.tasks.config.BROKER_URL = 'memory://' self.tasks.config.CELERY_RESULT_BACKEND = 'cache' self.tasks.config.CELERY_CACHE_BACKEND = 'memory' self.tasks.db = self.db
def setUp(self): self.app, self.db = setup_application.create_app('True') self.app_context = self.app.app_context() self.app_context.push() self.client = self.app.test_client() self.client.get('/') self.tasks = cap.tasks if not re.search('_test', self.tasks.config.MONGO_DATABASE): self.tasks.config.MONGO_DATABASE = ( '%s_test' % self.tasks.config.MONGO_DATABASE) self.tasks.config.BROKER_URL = 'memory://' self.tasks.config.CELERY_RESULT_BACKEND = 'cache' self.tasks.config.CELERY_CACHE_BACKEND = 'memory' self.tasks.db = self.db self.db.products.remove({}) self.db.limit_maps.remove({})
from cap.setup_application import create_app if __name__ == '__main__': app = create_app() app.run(host='0.0.0.0', port=5000, debug=True)