mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-19 05:58:53 -04:00
Update limit to message_limit.
Further db changes and updates. Remove traceback print out. Fix bug in passing template id to a task.
This commit is contained in:
@@ -27,28 +27,23 @@ def notify_api(request):
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
def notify_db(notify_api, request):
|
||||
try:
|
||||
Migrate(notify_api, db)
|
||||
Manager(db, MigrateCommand)
|
||||
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
|
||||
ALEMBIC_CONFIG = os.path.join(BASE_DIR, 'migrations')
|
||||
config = Config(ALEMBIC_CONFIG + '/alembic.ini')
|
||||
config.set_main_option("script_location", ALEMBIC_CONFIG)
|
||||
Migrate(notify_api, db)
|
||||
Manager(db, MigrateCommand)
|
||||
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
|
||||
ALEMBIC_CONFIG = os.path.join(BASE_DIR, 'migrations')
|
||||
config = Config(ALEMBIC_CONFIG + '/alembic.ini')
|
||||
config.set_main_option("script_location", ALEMBIC_CONFIG)
|
||||
|
||||
with notify_api.app_context():
|
||||
upgrade(config, 'head')
|
||||
with notify_api.app_context():
|
||||
upgrade(config, 'head')
|
||||
|
||||
def teardown():
|
||||
db.session.remove()
|
||||
db.engine.execute("drop sequence services_id_seq cascade")
|
||||
db.drop_all()
|
||||
db.engine.execute("drop table alembic_version")
|
||||
db.get_engine(notify_api).dispose()
|
||||
def teardown():
|
||||
db.session.remove()
|
||||
db.drop_all()
|
||||
db.engine.execute("drop table alembic_version")
|
||||
db.get_engine(notify_api).dispose()
|
||||
|
||||
request.addfinalizer(teardown)
|
||||
except:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
request.addfinalizer(teardown)
|
||||
return db
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user