aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortilly-Q <nattilypigeonfowl@gmail.com>2013-07-31 20:50:38 -0400
committertilly-Q <nattilypigeonfowl@gmail.com>2013-07-31 20:50:38 -0400
commit84c1cd7c52e7a07f2e0605433f255d946fe2737a (patch)
treefcd0fd5b1110c527aa3d7a537367fef4f2c6dc95
parent07e61ef13a62752d1321f2e9b6e6ff62d474023c (diff)
downloadmediagoblin-84c1cd7c52e7a07f2e0605433f255d946fe2737a.tar.lz
mediagoblin-84c1cd7c52e7a07f2e0605433f255d946fe2737a.tar.xz
mediagoblin-84c1cd7c52e7a07f2e0605433f255d946fe2737a.zip
I added a few more unitests in this commit. It now confirms that even after mi-
-gration, there is only one of each Foundation object.
-rw-r--r--mediagoblin/tests/test_sql_migrations.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/mediagoblin/tests/test_sql_migrations.py b/mediagoblin/tests/test_sql_migrations.py
index a004aa43..3d67fdf6 100644
--- a/mediagoblin/tests/test_sql_migrations.py
+++ b/mediagoblin/tests/test_sql_migrations.py
@@ -59,7 +59,8 @@ class Level1(Base1):
SET1_MODELS = [Creature1, Level1]
FOUNDATIONS = {Creature1:[{'name':u'goblin','num_legs':2,'is_demon':False},
- {'name':u'cerberus','num_legs':4,'is_demon':True}]}
+ {'name':u'cerberus','num_legs':4,'is_demon':True}]
+ }
SET1_MIGRATIONS = {}
@@ -790,6 +791,15 @@ def test_set1_to_set3():
# Now check to see if stuff seems to be in there.
session = Session()
+
+
+ # Start with making sure that the foundations did not run again
+ assert session.query(Creature3).filter_by(
+ name=u'goblin').count() == 1
+ assert session.query(Creature3).filter_by(
+ name=u'cerberus').count() == 1
+
+ # Then make sure the models have been migrated correctly
creature = session.query(Creature3).filter_by(
name=u'centipede').one()
assert creature.num_limbs == 100.0