Exemplo n.º 1
0
def test_up_up_and_down(db):
    migration.up(db, MIGRATIONS)
    migration.up(db, MIGRATIONS)
    migration.down(db, MIGRATIONS)
    assert trim_backend_tables(tables(db)) == [VERSION_TABLE, 'first']
Exemplo n.º 2
0
def test_up_with_python_then_down(db):
    migration.up(db, MIGRATIONS)
    migration.up(db, MIGRATIONS)
    insert(db, 'second', 22)
    migration.down(db, MIGRATIONS)
    assert list_basic(db, 'first') == [{'id': 2, 'age': 22}]
Exemplo n.º 3
0
def test_two_ups(db):
    migration.up(db, MIGRATIONS)
    migration.up(db, MIGRATIONS)
    assert trim_backend_tables(tables(db)) == [VERSION_TABLE, 'first', 'second']
Exemplo n.º 4
0
def test_one_up_is_empty(db):
    migration.up(db, MIGRATIONS)
    assert list_basic(db, 'first') == []
Exemplo n.º 5
0
def test_up_with_python(db):
    migration.up(db, MIGRATIONS)
    migration.up(db, MIGRATIONS)
    assert list_basic(db, 'second') == [{'id': 1, 'age': 42}]
Exemplo n.º 6
0
def test_up_and_down_multiple_operations(db):
    migration.up(db, MIGRATIONS)
    migration.down(db, MIGRATIONS)
    assert trim_backend_tables(tables(db)) == [VERSION_TABLE]
Exemplo n.º 7
0
def test_up_multiple_operations(db):
    migration.up(db, MIGRATIONS)
    assert trim_backend_tables(tables(db)) == [VERSION_TABLE, 'one', 'two']
Exemplo n.º 8
0
def test_up_with_python_then_down(db):
    migration.up(db, MIGRATIONS)
    migration.up(db, MIGRATIONS)
    insert(db, 'second', 22)
    migration.down(db, MIGRATIONS)
    assert list_basic(db, 'first') == [{'id': 2, 'age': 22}]
Exemplo n.º 9
0
def test_up_with_python(db):
    migration.up(db, MIGRATIONS)
    migration.up(db, MIGRATIONS)
    assert list_basic(db, 'second') == [{'id': 1, 'age': 42}]
Exemplo n.º 10
0
def test_one_up_is_empty(db):
    migration.up(db, MIGRATIONS)
    assert list_basic(db, 'first') == []