'Given an existing authenticated user, and an updated identity (e.g.
the ident changed from the SSO provider), we should be prompting to
confirm their identity as they dont have membership.'

def test_flow_managed_duplicate_users_without_membership(self):

    organization = self.create_organization(name='foo', owner=self.user)
    auth_provider = AuthProvider.objects.create(organization=organization, provider='dummy')
    user = self.create_user('bar@example.com', is_active=False, is_managed=True)
    AuthIdentity.objects.create(auth_provider=auth_provider, user=user, ident='bar@example.com')
    self.login_as(user)
    path = reverse('sentry-auth-organization', args=[organization.slug])
    resp = self.client.post(path)
    assert (resp.status_code == 200)
    assert (self.provider.TEMPLATE in resp.content.decode('utf-8'))
    path = reverse('sentry-auth-sso')
    resp = self.client.post(path, {'email': 'adfadsf@example.com'})
    self.assertTemplateUsed(resp, 'sentry/auth-confirm-link.html')
    assert (resp.status_code == 200)
    assert (resp.context['existing_user'] == user)
