Skip to content

Commit

Permalink
Correct redirect test
Browse files Browse the repository at this point in the history
  • Loading branch information
dcramer committed Jun 4, 2013
1 parent b421eca commit 1825d98
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/sentry/web/frontend/generic/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,13 @@ def test_redirects_to_new_team_when_possible(self, can_create_teams):
assert resp['Location'] == 'http://testserver' + reverse('sentry-new-team')

@mock.patch('sentry.web.frontend.generic.can_create_teams', mock.Mock(return_value=True))
def test_redirects_to_first_team_when_possible(self):
# HACK: force team creation
team = self.team
def test_shows_team_selector_with_single(self):
Team.objects.create(name='test', owner=self.user)

resp = self.client.get(self.path)

assert resp.status_code == 302
assert resp['Location'] == 'http://testserver' + reverse('sentry', args=[team.slug])
assert resp.status_code == 200
self.assertTemplateUsed(resp, 'sentry/select_team.html')

@mock.patch('sentry.web.frontend.generic.can_create_teams', mock.Mock(return_value=True))
def test_renders_team_selector_with_multiple(self):
Expand Down

0 comments on commit 1825d98

Please sign in to comment.