Пример #1
0
def test_delete_not_found(tmpdir, caplog):
    manager = DatabaseManager('sqlite:///:memory:', directory=tmpdir)
    manager.revision()
    manager.upgrade()

    manager.delete('does-not-exist')
    assert 'could not find migration: does-not-exist' in caplog.text
Пример #2
0
def test_delete_not_found(tmpdir, caplog):
    manager = DatabaseManager('sqlite:///:memory:', directory=tmpdir)
    manager.revision()
    manager.upgrade()

    manager.delete('does-not-exist')
    assert 'could not find migration: does-not-exist' in caplog.text
Пример #3
0
def test_delete(tmpdir, caplog):
    manager = DatabaseManager('sqlite:///:memory:', directory=tmpdir)
    manager.revision()
    manager.upgrade()
    migrations = manager.migration_files

    manager.delete(migrations[0])
    assert 'deleted: {}'.format(migrations[0]) in caplog.text

    assert not manager.db_migrations
    assert not manager.migration_files
Пример #4
0
def test_delete(tmpdir, caplog):
    manager = DatabaseManager('sqlite:///:memory:', directory=tmpdir)
    manager.revision()
    manager.upgrade()
    migrations = manager.migration_files

    manager.delete(migrations[0])
    assert 'deleted: {}'.format(migrations[0]) in caplog.text

    assert not manager.db_migrations
    assert not manager.migration_files