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:
Nicholas Staples
2016-04-08 16:13:10 +01:00
parent c4b316bde6
commit 90f0505a3d
19 changed files with 116 additions and 116 deletions

View File

@@ -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