示例#1
0
 def test_necessary_update(self):
     user = get_or_create_user(self.user_infos)
     person = Person(user=None, first_name="user3", last_name="user3", email='*****@*****.**', global_id="1111111")
     updated, updated_person = mdl_signals._update_person_if_necessary(user=user,
                                                                       person=person,
                                                                       global_id=self.user_infos.get('USER_FGS'))
     self.assertTrue(updated)
     assert_person_match_user_infos(self, updated_person, self.user_infos)
示例#2
0
 def test_unnecessary_update(self):
     user = get_or_create_user(self.user_infos)
     person = Person(user=user,
                     first_name=self.user_infos.get('USER_FIRST_NAME'),
                     last_name=self.user_infos.get('USER_LAST_NAME'),
                     email=self.user_infos.get('USER_EMAIL'),
                     global_id=self.user_infos.get('USER_FGS'))
     updated, updated_person = mdl_signals._update_person_if_necessary(user=user,
                                                                       person=person,
                                                                       global_id=self.user_infos.get('USER_FGS'))
     self.assertFalse(updated)
     assert_person_match_user_infos(self, updated_person, self.user_infos)
示例#3
0
 def test_unnecessary_update(self):
     user = get_or_create_user(self.user_infos)
     person = Person(user=user,
                     first_name=self.user_infos.get('USER_FIRST_NAME'),
                     last_name=self.user_infos.get('USER_LAST_NAME'),
                     email=self.user_infos.get('USER_EMAIL'),
                     global_id=self.user_infos.get('USER_FGS'))
     updated, updated_person = mdl_signals._update_person_if_necessary(
         user=user,
         person=person,
         global_id=self.user_infos.get('USER_FGS'))
     self.assertFalse(updated)
     assert_person_match_user_infos(self, updated_person, self.user_infos)
示例#4
0
 def test_necessary_update(self):
     user = get_or_create_user(self.user_infos)
     person = Person(user=None,
                     first_name="user3",
                     last_name="user3",
                     email='*****@*****.**',
                     global_id="1111111")
     updated, updated_person = mdl_signals._update_person_if_necessary(
         user=user,
         person=person,
         global_id=self.user_infos.get('USER_FGS'))
     self.assertTrue(updated)
     assert_person_match_user_infos(self, updated_person, self.user_infos)