def test_full_identity(self): ident = resources.IdentitySet(self.data) self.assertIsInstance(ident.user, resources.Identity) self.assertEqual(ident.user.id, self.data['user']['id']) self.assertEqual(ident.user.display_name, self.data['user']['displayName']) self.assertIsInstance(ident.device, resources.Identity) self.assertEqual(ident.device.id, self.data['device']['id']) self.assertEqual(ident.device.display_name, self.data['device']['displayName']) self.assertIsInstance(ident.application, resources.Identity) self.assertEqual(ident.application.id, self.data['application']['id']) self.assertEqual(ident.application.display_name, self.data['application']['displayName'])
def last_modified_by(self): """ :rtype: resources.IdentitySet """ return resources.IdentitySet(self._data['lastModifiedBy'])
def created_by(self): """ :rtype: resources.IdentitySet """ return resources.IdentitySet(self._data['createdBy'])
def test_partial_identity(self): del self.data['user'] ident = resources.IdentitySet(self.data) self.assertIsNone(ident.user) self.assertIsInstance(ident.device, resources.Identity) self.assertIsInstance(ident.application, resources.Identity)