diff --git a/opentech/apply/users/tests/test_views.py b/opentech/apply/users/tests/test_views.py index 443f007fa968d1facdffd97f2dcebc5565319e29..935dcdc981e7301ad4f28cd84a204fb775c4ee3e 100644 --- a/opentech/apply/users/tests/test_views.py +++ b/opentech/apply/users/tests/test_views.py @@ -17,20 +17,21 @@ class TestProfileView(BaseTestProfielView): def test_cant_acces_if_not_logged_in(self): self.client.logout() - response = self.client.get(self.url) - self.assertRedirects(response, reverse('users:login') + '?next=' + self.url) + response = self.client.get(self.url, follow=True) + # Initial redirect will be via to https through a 301 + self.assertRedirects(response, reverse('users:login') + '?next=' + self.url, status_code=301) def test_includes_change_password(self): - response = self.client.get(self.url) + response = self.client.get(self.url, follow=True) self.assertContains(response, reverse('users:password_change')) def test_doesnt_includes_change_password_for_oauth(self): self.client.force_login(OAuthUserFactory()) - response = self.client.get(self.url) + response = self.client.get(self.url, follow=True) self.assertNotContains(response, reverse('users:password_change')) def test_cant_set_slack_name(self): - response = self.client.get(self.url) + response = self.client.get(self.url, follow=True) self.assertNotContains(response, 'Slack name') @@ -40,5 +41,5 @@ class TestStaffProfileView(BaseTestProfielView): self.client.force_login(self.staff) def test_can_set_slack_name(self): - response = self.client.get(self.url) + response = self.client.get(self.url, follow=True) self.assertContains(response, 'Slack name')