def testRenamedContacts(self):
    contacts = self._TestFetchContacts(self._andy_facebook, self._andy_user.user_id,
                                       {'data': [{'id': 200, 'name': 'Andrew Kimball'},
                                                 {'id': 300, 'name': 'Spencer Kimball', 'first_name': 'Spencer'},
                                                 {'id': 400, 'name': 'Kathryn Kimball', 'last_name': 'Kimball'},
                                                 {'id': 500, 'name': 'Michael Purtell'},
                                                 {'id': 600, 'name': 'Peter Mattis', 'last_name': 'Mattis'}]})
    contacts = self._TestFetchContacts(self._andy_facebook, self._andy_user.user_id,
                                       {'data': [{'id': 200, 'name': 'Andy Kimball'},
                                                 {'id': 300, 'name': 'Spencer Kimball', 'first_name': 'Spence'},
                                                 {'id': 400, 'name': 'Kathryn Kimball', 'last_name': 'Mattis'},
                                                 {'id': 500,
                                                  'name': 'Mike Purtell Reincarnated',
                                                  'first_name': 'Mike',
                                                  'last_name': 'Purtell Reincarnated'},
                                                 {'id': 600, 'name': 'Pete Mattis', 'first_name': 'Pete'}]})
    self.assertEqual(contacts[0].name, 'Andy Kimball')
    self.assertEqual(contacts[1].name, 'Spencer Kimball')
    self.assertEqual(contacts[1].given_name, 'Spence')
    self.assertEqual(contacts[2].name, 'Kathryn Kimball')
    self.assertEqual(contacts[2].family_name, 'Mattis')
    self.assertEqual(contacts[3].name, 'Mike Purtell Reincarnated')
    self.assertEqual(contacts[4].name, 'Pete Mattis')
    self.assertEqual(contacts[4].given_name, 'Pete')
    self.assertIsNone(contacts[4].family_name)

    contacts = self._TestFetchContacts(self._andy_google, self._andy_user.user_id,
                                       self._CreateGoogleContactFeed([{'emails': [('kimball.andy@emailscrubbed.com', None)],
                                                                       'name': 'Andrew Kimball'},
                                                                      {'emails': [('spencer@emailscrubbed.com', None)],
                                                                       'name': 'Spencer Kimball',
                                                                       'given_name': 'Spencer'},
                                                                      {'emails': [('kat@foo.com', None)],
                                                                       'family_name': 'Kimball'},
                                                                      {'emails': [('mike@emailscrubbed.com', None)],
                                                                       'phones': [('+15151234567', None)]},
                                                                      {'emails': [('pete@emailscrubbed.com', None)],
                                                                       'family_name': 'Mattis'}]))
    contacts = self._TestFetchContacts(self._andy_google, self._andy_user.user_id,
                                       self._CreateGoogleContactFeed([{'emails': [('kimball.andy@emailscrubbed.com', None)],
                                                                       'name': 'Andy Kimball'},
                                                                      {'emails': [('spencer@emailscrubbed.com', None)],
                                                                       'phones': [('+15151234567', 'Boat')],
                                                                       'name': 'Spencer Kimball',
                                                                       'given_name': 'Spence'},
                                                                      {'emails': [('kat@foo.com', None)],
                                                                       'family_name': 'Mattis'},
                                                                      {'emails': [('mike@emailscrubbed.com', None)],
                                                                       'phones': [('+12121234567', None)],
                                                                       'name': 'Mike Purtell',
                                                                       'given_name': 'Mike',
                                                                       'family_name': 'Purtell'},
                                                                      {'emails': [('pete@emailscrubbed.com', None)],
                                                                       'given_name': 'Pete'}]))
    self.assertEqual(contacts[0].name, 'Andy Kimball')
    self.assertEqual(contacts[1].name, 'Spencer Kimball')
    self.assertEqual(contacts[1].given_name, 'Spence')
    self.assertIn('Phone:+15151234567', contacts[1].identities)
    self.assertIn(['Phone:+15151234567', 'Boat'], contacts[1].identities_properties)
    self.assertEqual(contacts[2].family_name, 'Mattis')
    self.assertEqual(contacts[3].name, 'Mike Purtell')
    self.assertIn('Phone:+12121234567', contacts[3].identities)
    self.assertIn(['Phone:+12121234567', None], contacts[3].identities_properties)
    self.assertEqual(contacts[4].given_name, 'Pete')
    self.assertIsNone(contacts[4].family_name)
Test fetching contacts, then same contacts with new names.
dataset/ETHPy150Open viewfinderco/viewfinder/backend/www/test/fetch_contacts_test.py/FetchContactsTestCase.testRenamedContacts