Пример #1
0
def test_migration_order(name):
    migration = loader.get_migration(name)
    assert migration
    if not migration.depends_on:
        return
    orders = get_migration_orders()
    assert name in orders, "Unordered migration"
    for d in migration.dependencies:
        assert d in orders, "Unordered dependency"
        assert orders[d] < orders[name], "Out-of-order dependency"
Пример #2
0
def test_migration_depends_on(name):
    migration = loader.get_migration(name)
    assert migration
    if not migration.depends_on:
        return
    assert isinstance(migration.depends_on, list), "depends_on must be of list type"
    for r in migration.depends_on:
        assert isinstance(r, tuple), "depends_on item must be of tuple type"
        assert len(r) == 2, "depends_on item must have size of 2"
        dep_name = "%s.%s" % (r[0], r[1])
        assert dep_name in get_migration_names_set(), "Unknown dependency %s" % r
Пример #3
0
def test_migration_class(name):
    migration = loader.get_migration(name)
    assert migration
    assert isinstance(migration, BaseMigration)