def test_multiple_collections_are_pseudonymized(self):
    self.save_new_valid_collection(self.COL_2_ID, self.user_1_id)
    self.publish_collection(self.user_1_id, self.COL_2_ID)
    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])
    commit_log_model = collection_models.CollectionCommitLogEntryModel.get_by_id(('collection-%s-1' % self.COL_1_ID))
    self.assertEqual(commit_log_model.user_id, collection_mappings[self.COL_1_ID])
    metadata_model = collection_models.CollectionSnapshotMetadataModel.get_by_id(('%s-1' % self.COL_2_ID))
    self.assertEqual(metadata_model.committer_id, collection_mappings[self.COL_2_ID])
    commit_log_model = collection_models.CollectionCommitLogEntryModel.get_by_id(('collection-%s-1' % self.COL_2_ID))
    self.assertEqual(commit_log_model.user_id, collection_mappings[self.COL_2_ID])
def test_multiple_collections_are_pseudonymized(self):
    self.save_new_valid_collection(self.COL_2_ID, self.user_1_id)
    self.publish_collection(self.user_1_id, self.COL_2_ID)
    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])
    commit_log_model = collection_models.CollectionCommitLogEntryModel.get_by_id(('collection-%s-1' % self.COL_1_ID))
    self.assertEqual(commit_log_model.user_id, collection_mappings[self.COL_1_ID])
    metadata_model = collection_models.CollectionSnapshotMetadataModel.get_by_id(('%s-1' % self.COL_2_ID))
    self.assertEqual(metadata_model.committer_id, collection_mappings[self.COL_2_ID])
    commit_log_model = collection_models.CollectionCommitLogEntryModel.get_by_id(('collection-%s-1' % self.COL_2_ID))
    self.assertEqual(commit_log_model.user_id, collection_mappings[self.COL_2_ID])