def test_one_collection_when_the_deletion_is_repeated_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))
    metadata_model = collection_models.CollectionSnapshotMetadataModel.get_by_id(('%s-1' % self.COL_1_ID))
    metadata_model.committer_id = self.user_1_id
    metadata_model.put_for_human()
    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])
def test_one_collection_when_the_deletion_is_repeated_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))
    metadata_model = collection_models.CollectionSnapshotMetadataModel.get_by_id(('%s-1' % self.COL_1_ID))
    metadata_model.committer_id = self.user_1_id
    metadata_model.put_for_human()
    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])