

def test_migration_removes_targets(self):
    GoogleDriveUserSettings.remove()
    user = UserFactory()
    project = ProjectFactory(creator=user)
    user.add_addon('googledrive', auth=Auth(user))
    user_addon = user.get_addon('googledrive')
    user_addon.oauth_settings = GoogleDriveOAuthSettingsFactory()
    user_addon.save()
    project.add_addon('googledrive', auth=Auth(user))
    node_addon = project.get_addon('googledrive')
    node_addon.foreign_user_settings = user_addon
    node_addon.save()
    assert_equal(get_targets().count(), 1)
    do_migration([user_addon])
    user_addon.reload()
    assert_equal(get_targets().count(), 0)

dataset/ETHPy150Open CenterForOpenScience/osf.io/scripts/tests/test_googledrive_migrate_to_external_account.py TestGoogleDriveMigration.test_migration_removes_targets/original