Current location

narf Source control manager Git

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2016-03-24 17:12:16 -0700
committerChristopher Allan Webber <cwebber@dustycloud.org>2016-03-26 11:39:08 -0700
commit544b7b47a16cff8a140e2e89784b7d6ad8a31286 (patch)
tree07163beb9442a5d4504a939681e67a3e87945aea
parentc527242841e7c7408d4307cac0ef049a6db80930 (diff)
Fix tests post-alembic-migration-changes.
* mediagoblin/init/__init__.py (setup_database): Update to run alembic migrations, skip the old legacy migrations.
-rw-r--r--mediagoblin/init/__init__.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/mediagoblin/init/__init__.py b/mediagoblin/init/__init__.py
index 38ec1260..05a26792 100644
--- a/mediagoblin/init/__init__.py
+++ b/mediagoblin/init/__init__.py
@@ -70,10 +70,16 @@ def setup_database(app):
# Set up the database
db = setup_connection_and_db_from_config(
app_config, run_migrations, app=app)
+ # run_migrations is used for tests
if run_migrations:
- #Run the migrations to initialize/update the database.
- from mediagoblin.gmg_commands.dbupdate import run_all_migrations
- run_all_migrations(db, app_config, global_config)
+ # Run the migrations to initialize/update the database.
+ # We only run the alembic migrations in the case of unit
+ # tests, in which case we don't need to run the legacy
+ # migrations.
+ from mediagoblin.gmg_commands.dbupdate import (
+ run_alembic_migrations, run_foundations)
+ run_alembic_migrations(db, app_config, global_config)
+ run_foundations(db, global_config)
else:
check_db_migrations_current(db)