

def test_migration_no_project(self):
    user = UserFactory()
    user.add_addon('googledrive')
    user_addon = user.get_addon('googledrive')
    user_addon.oauth_settings = GoogleDriveOAuthSettingsFactory()
    user_addon.save()
    do_migration([user_addon])
    user_addon.reload()
    assert_is_none(user_addon.oauth_settings)
    assert_equal(len(user.external_accounts), 1)
    account = user.external_accounts[0]
    assert_equal(account.provider, 'googledrive')
    assert_equal(account.oauth_key, 'abcdef1')

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