diff options
author | olly <olly@ollycope.com> | 2013-09-17 10:22:36 +0000 |
---|---|---|
committer | olly <olly@ollycope.com> | 2013-09-17 10:22:36 +0000 |
commit | b962606c7ca6801c8f8ca40f211e93dc00ed0224 (patch) | |
tree | 48345f4d5205d972fe7cb3757cba9d06a7aee9f3 | |
parent | d561a3f1f662bb10bb8155403de06dcecc2927a6 (diff) | |
download | yoyo-b962606c7ca6801c8f8ca40f211e93dc00ed0224.tar.gz |
Added test for importing step and transaction
-rw-r--r-- | yoyo/tests.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/yoyo/tests.py b/yoyo/tests.py index b010bfa..5fb88f7 100644 --- a/yoyo/tests.py +++ b/yoyo/tests.py @@ -180,3 +180,20 @@ def test_migration_functions_have_namespace_access(tmpdir): cursor = conn.cursor() cursor.execute("SELECT id FROM foo_test") assert cursor.fetchall() == [(1,)] + + +@with_migrations( + ''' + from yoyo import transaction, step + step("CREATE TABLE test (id INT)") + transaction(step("INSERT INTO test VALUES (1)")), + ''' +) +def test_migrations_can_import_step_and_transaction(tmpdir): + conn, paramstyle = connect(dburi) + migrations = read_migrations(conn, paramstyle, tmpdir, + migration_table='another_migration_table') + migrations.apply() + cursor = conn.cursor() + cursor.execute("SELECT id FROM test") + assert cursor.fetchall() == [(1,)] |