@@ -181,7 +181,7 @@ def test_invalid_model_attribute_log(self):
181181 }
182182
183183 with self .assertLogs ('djangosaml2' , level = 'DEBUG' ) as logs :
184- user , _ = self .backend .get_or_create_user (self .backend ._user_lookup_attribute , 'john' , True )
184+ user , _ = self .backend .get_or_create_user (self .backend ._user_lookup_attribute , 'john' , True , None , None , None , None , None )
185185 self .backend ._update_user (user , attributes , attribute_mapping )
186186
187187 self .assertIn (
@@ -200,11 +200,7 @@ def test_create_user_with_required_fields(self):
200200 'mail_verified' : [True ],
201201 }
202202 # User creation does not fail if several fields are required.
203- user , created = self .backend .get_or_create_user (
204- self .backend ._user_lookup_attribute ,
205- 'john@example.org' ,
206- True
207- )
203+ user , created = self .backend .get_or_create_user (self .backend ._user_lookup_attribute , 'john@example.org' , True , None , None , None , None , None )
208204
209205 self .assertEquals (user .email , 'john@example.org' )
210206 self .assertIs (user .email_verified , None )
@@ -238,6 +234,7 @@ def test_get_or_create_user_existing(self):
238234 self .backend ._user_lookup_attribute ,
239235 'john' ,
240236 False ,
237+ None , None , None , None , None
241238 )
242239
243240 self .assertTrue (isinstance (user , TestUser ))
@@ -252,6 +249,7 @@ def test_get_or_create_user_duplicates(self):
252249 'age' ,
253250 '' ,
254251 False ,
252+ None , None , None , None , None
255253 )
256254
257255 self .assertTrue (user is None )
@@ -268,6 +266,7 @@ def test_get_or_create_user_no_create(self):
268266 self .backend ._user_lookup_attribute ,
269267 'paul' ,
270268 False ,
269+ None , None , None , None , None
271270 )
272271
273272 self .assertTrue (user is None )
@@ -284,6 +283,7 @@ def test_get_or_create_user_create(self):
284283 self .backend ._user_lookup_attribute ,
285284 'paul' ,
286285 True ,
286+ None , None , None , None , None
287287 )
288288
289289 self .assertTrue (isinstance (user , TestUser ))
@@ -313,9 +313,6 @@ def clean_user_main_attribute(self, main_attribute):
313313 ''' Replace all spaces an dashes by underscores '''
314314 return main_attribute .replace ('-' , '_' ).replace (' ' , '_' )
315315
316- def get_or_create_user (self , user_lookup_key , user_lookup_value , create_unknown_user , ** kwargs ):
317- return super ().get_or_create_user (user_lookup_key , user_lookup_value , create_unknown_user , ** kwargs )
318-
319316
320317class CustomizedSaml2BackendTests (Saml2BackendTests ):
321318 backend_cls = CustomizedBackend
@@ -367,7 +364,7 @@ def test_authenticate(self):
367364
368365 user = self .backend .authenticate (
369366 None ,
370- session_info = {'ava' : attributes },
367+ session_info = {'ava' : attributes , 'issuer' : 'dummy_entity_id' , 'name_id' : 'john' },
371368 attribute_mapping = attribute_mapping ,
372369 )
373370
@@ -402,7 +399,7 @@ def test_update_user_clean_attributes(self):
402399 backend = LowerCaseSaml2Backend ()
403400 user = backend .authenticate (
404401 None ,
405- session_info = {'ava' : attributes },
402+ session_info = {'ava' : attributes , 'issuer' : 'dummy_entity_id' , 'name_id' : 'john' },
406403 attribute_mapping = attribute_mapping ,
407404 )
408405 self .assertIsNotNone (user )
0 commit comments