aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElrond <elrond+mediagoblin.org@samba-tng.org>2011-10-22 00:21:25 +0200
committerElrond <elrond+mediagoblin.org@samba-tng.org>2011-10-22 00:21:25 +0200
commit733dc2c27595961e17fd9ab205c1f47e8e3918a6 (patch)
treef0e78e279d5e8669acc886110b9c0858413df460
parent03d47730cdced0002d4b0c76726336152f041bdb (diff)
downloadmediagoblin-733dc2c27595961e17fd9ab205c1f47e8e3918a6.tar.lz
mediagoblin-733dc2c27595961e17fd9ab205c1f47e8e3918a6.tar.xz
mediagoblin-733dc2c27595961e17fd9ab205c1f47e8e3918a6.zip
Change unit tests to use add_table_field
One of the test migrations adds a field. So rewrite it to use the new add_table_field helper function. This is a good test for it.
-rw-r--r--mediagoblin/tests/test_migrations.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/mediagoblin/tests/test_migrations.py b/mediagoblin/tests/test_migrations.py
index fc2449f7..e7cef0a1 100644
--- a/mediagoblin/tests/test_migrations.py
+++ b/mediagoblin/tests/test_migrations.py
@@ -23,6 +23,7 @@ from mediagoblin.tests.tools import (
from mediagoblin.db.util import (
RegisterMigration, MigrationManager, ObjectId,
MissingCurrentMigration)
+from mediagoblin.db.migrations import add_table_field
# This one will get filled with local migrations
TEST_MIGRATION_REGISTRY = {}
@@ -45,10 +46,7 @@ def creature_add_magical_powers(database):
magical powers, all existing monsters, setting to an empty list is
fine.
"""
- database['creatures'].update(
- {'magical_powers': {'$exists': False}},
- {'$set': {'magical_powers': []}},
- multi=True)
+ add_table_field(database, 'creatures', 'magical_powers', [])
@RegisterMigration(2, TEST_MIGRATION_REGISTRY)