old_contents: from __future__ import absolute_import
  
  from django.core.urlresolvers import reverse
  
  from sentry.models import AuthProvider
  from sentry.testutils import AuthProviderTestCase
  
  
  class OrganizationAuthSettingsTest(AuthProviderTestCase):
      def test_renders_basic_login_form(self):
          organization = self.create_organization(name='foo', owner=self.user)
          team = self.create_team(organization=organization)
          project = self.create_project(team=team)
  
          path = reverse('sentry-auth-organization', args=[organization.slug])
  
          self.login_as(self.user)
  
          resp = self.client.get(path)
  
          assert resp.status_code == 200
  
          self.assertTemplateUsed(resp, 'sentry/organization-login.html')
  
          assert resp.context['form']
          assert 'provider_key' not in resp.context
          assert resp.context['CAN_REGISTER']
  
      def test_renders_auth_provider(self):
          organization = self.create_organization(name='foo', owner=self.user)
          team = self.create_team(organization=organization)
          project = self.create_project(team=team)
          auth_provider = AuthProvider.objects.create(
              organization=organization,
              provider='dummy',
          )
  
          path = reverse('sentry-auth-organization', args=[organization.slug])
  
          self.login_as(self.user)
  
          resp = self.client.get(path)
  
          self.assertTemplateUsed(resp, 'sentry/organization-login.html')
  
          assert 'form' not in resp.context
          assert resp.context['provider_key'] == 'dummy'
          assert not resp.context['CAN_REGISTER']
  
new_contents: from __future__ import absolute_import
  
  from django.core.urlresolvers import reverse
  
  from sentry.models import AuthProvider
  from sentry.testutils import AuthProviderTestCase
  
  
  class OrganizationAuthSettingsTest(AuthProviderTestCase):
      def test_renders_basic_login_form(self):
          organization = self.create_organization(name='foo', owner=self.user)
          team = self.create_team(organization=organization)
          project = self.create_project(team=team)
  
          path = reverse('sentry-auth-organization', args=[organization.slug])
  
          self.login_as(self.user)
  
          resp = self.client.get(path)
  
          assert resp.status_code == 200
  
          self.assertTemplateUsed(resp, 'sentry/organization-login.html')
  
          assert resp.context['form']
          assert 'provider_key' not in resp.context
          assert resp.context['CAN_REGISTER']
  
      def test_renders_auth_provider(self):
          organization = self.create_organization(name='foo', owner=self.user)
          team = self.create_team(organization=organization)
          project = self.create_project(team=team)
          auth_provider = AuthProvider.objects.create(
              organization=organization,
              provider='dummy',
          )
  
          path = reverse('sentry-auth-organization', args=[organization.slug])
  
          self.login_as(self.user)
  
          resp = self.client.get(path)
  
          self.assertTemplateUsed(resp, 'sentry/organization-login.html')
  
          assert resp.context['provider_key'] == 'dummy'
          assert not resp.context['CAN_REGISTER']
  
subject: Correct test