コード例 #1
0
 def test_get_user_details_missing_keys(self):
     lti = LTIAuthBackend()
     details = lti.get_user_details(
         {LTI_PARAMS_KEY: {
             'lis_person_name_full': 'Full name'
         }})
     self.assertEqual(details, {'fullname': 'Full name'})
コード例 #2
0
 def test_get_user_details_extra_keys(self):
     lti = LTIAuthBackend()
     details = lti.get_user_details({LTI_PARAMS_KEY: {
         'lis_person_name_full': 'Full name',
         'lis_person_name_given': 'Given',
         'lis_person_name_family': 'Family',
         'email': '*****@*****.**',
         'other': 'something else'
     }})
     assert details == {'fullname': 'Full name', 'first_name': 'Given',
                        'last_name': 'Family', 'email': '*****@*****.**'}