@@ -85,7 +85,6 @@ def test_get_invalid_user(self):
8585
8686 self .assertEqual (self .backend .get_user (user_id = 1 ), None )
8787
88- @override_settings (SITE_URL = 'http://site-url.com' )
8988 @patch ('mozilla_django_oidc.auth.requests' )
9089 @patch ('mozilla_django_oidc.auth.OIDCAuthenticationBackend.verify_token' )
9190 def test_successful_authentication_existing_user (self , token_mock , request_mock ):
@@ -115,7 +114,7 @@ def test_successful_authentication_existing_user(self, token_mock, request_mock)
115114 'client_secret' : 'client_secret' ,
116115 'grant_type' : 'authorization_code' ,
117116 'code' : 'foo' ,
118- 'redirect_uri' : 'http://site-url.com /callback/'
117+ 'redirect_uri' : 'http://testserver /callback/'
119118 }
120119 self .assertEqual (self .backend .authenticate (request = auth_request ), user )
121120 token_mock .assert_called_once_with ('id_token' , nonce = None )
@@ -127,7 +126,6 @@ def test_successful_authentication_existing_user(self, token_mock, request_mock)
127126 headers = {'Authorization' : 'Bearer access_granted' }
128127 )
129128
130- @override_settings (SITE_URL = 'http://site-url.com' )
131129 @patch ('mozilla_django_oidc.auth.requests' )
132130 @patch ('mozilla_django_oidc.auth.OIDCAuthenticationBackend.verify_token' )
133131 def test_successful_authentication_existing_user_upper_case (self , token_mock , request_mock ):
@@ -157,7 +155,7 @@ def test_successful_authentication_existing_user_upper_case(self, token_mock, re
157155 'client_secret' : 'client_secret' ,
158156 'grant_type' : 'authorization_code' ,
159157 'code' : 'foo' ,
160- 'redirect_uri' : 'http://site-url.com /callback/'
158+ 'redirect_uri' : 'http://testserver /callback/'
161159 }
162160 self .assertEqual (self .backend .authenticate (request = auth_request ), user )
163161 token_mock .assert_called_once_with ('id_token' , nonce = None )
@@ -172,7 +170,6 @@ def test_successful_authentication_existing_user_upper_case(self, token_mock, re
172170 @patch .object (settings , 'OIDC_USERNAME_ALGO' )
173171 @patch ('mozilla_django_oidc.auth.requests' )
174172 @patch ('mozilla_django_oidc.auth.OIDCAuthenticationBackend.verify_token' )
175- @override_settings (SITE_URL = 'http://site-url.com' )
176173 def test_successful_authentication_new_user (self , token_mock , request_mock , algo_mock ):
177174 """Test successful authentication and user creation."""
178175 auth_request = RequestFactory ().get ('/foo' , {'code' : 'foo' ,
@@ -198,7 +195,7 @@ def test_successful_authentication_new_user(self, token_mock, request_mock, algo
198195 'client_secret' : 'client_secret' ,
199196 'grant_type' : 'authorization_code' ,
200197 'code' : 'foo' ,
201- 'redirect_uri' : 'http://site-url.com /callback/' ,
198+ 'redirect_uri' : 'http://testserver /callback/' ,
202199 }
203200 self .assertEqual (User .objects .all ().count (), 0 )
204201 self .backend .authenticate (request = auth_request )
0 commit comments