def test_login_view_redirects_to_fxa_url(self):
        test_settings = {
            'FXA_CLIENT_ID': 'fxa_client_id',
            'FXA_SCOPE': 'profile leaderboard',
            'FXA_OAUTH_URI': 'http://example.com/v1/oauth/',
            'FXA_PROFILE_URI': 'http://example.com/v1/profile/',
        }

        with self.settings(**test_settings):
            response = self.client.get(reverse('fxa-login'))

            self.assertEqual(response.status_code, 302)
            self.assertEqual(
                response.url, get_fxa_login_url('http://testserver/'))
Beispiel #2
0
 def get(self, request):
     base_url = request.build_absolute_uri('/')
     return redirect(get_fxa_login_url(base_url))