def test_one_collection_snapshot_metadata_is_pseudonymized(self):
    wipeout_service.pre_delete_user(self.user_1_id)
    self.process_and_flush_pending_tasks()
    wipeout_service.delete_user(wipeout_service.get_pending_deletion_request(self.user_1_id))
    collection_mappings = user_models.PendingDeletionRequestModel.get_by_id(self.user_1_id).pseudonymizable_entity_mappings[models.NAMES.collection]
    metadata_model = collection_models.CollectionSnapshotMetadataModel.get_by_id(('%s-1' % self.COL_1_ID))
    self.assertEqual(metadata_model.committer_id, collection_mappings[self.COL_1_ID])
    rights_metadata_model_1 = collection_models.CollectionRightsSnapshotMetadataModel.get_by_id(('%s-1' % self.COL_1_ID))
    self.assertEqual(rights_metadata_model_1.committer_id, collection_mappings[self.COL_1_ID])
    self.assertEqual(rights_metadata_model_1.content_user_ids, [collection_mappings[self.COL_1_ID]])
    self.assertEqual(rights_metadata_model_1.commit_cmds_user_ids, [])
    rights_metadata_model_2 = collection_models.CollectionRightsSnapshotMetadataModel.get_by_id(('%s-2' % self.COL_1_ID))
    self.assertEqual(rights_metadata_model_2.committer_id, collection_mappings[self.COL_1_ID])
    self.assertEqual(rights_metadata_model_2.content_user_ids, [collection_mappings[self.COL_1_ID]])
    self.assertEqual(rights_metadata_model_2.commit_cmds_user_ids, [])
def test_one_collection_snapshot_metadata_is_pseudonymized(self):
    wipeout_service.pre_delete_user(self.user_1_id)
    self.process_and_flush_pending_tasks()
    wipeout_service.delete_user(wipeout_service.get_pending_deletion_request(self.user_1_id))
    collection_mappings = user_models.PendingDeletionRequestModel.get_by_id(self.user_1_id).pseudonymizable_entity_mappings[models.NAMES.collection]
    metadata_model = collection_models.CollectionSnapshotMetadataModel.get_by_id(('%s-1' % self.COL_1_ID))
    self.assertEqual(metadata_model.committer_id, collection_mappings[self.COL_1_ID])
    rights_metadata_model_1 = collection_models.CollectionRightsSnapshotMetadataModel.get_by_id(('%s-1' % self.COL_1_ID))
    self.assertEqual(rights_metadata_model_1.committer_id, collection_mappings[self.COL_1_ID])
    self.assertEqual(rights_metadata_model_1.content_user_ids, [collection_mappings[self.COL_1_ID]])
    self.assertEqual(rights_metadata_model_1.commit_cmds_user_ids, [])
    rights_metadata_model_2 = collection_models.CollectionRightsSnapshotMetadataModel.get_by_id(('%s-2' % self.COL_1_ID))
    self.assertEqual(rights_metadata_model_2.committer_id, collection_mappings[self.COL_1_ID])
    self.assertEqual(rights_metadata_model_2.content_user_ids, [collection_mappings[self.COL_1_ID]])
    self.assertEqual(rights_metadata_model_2.commit_cmds_user_ids, [])