def test_multiple_explorations_are_pseudonymized(self):
    self.save_new_valid_exploration(self.EXP_2_ID, self.user_1_id)
    self.publish_exploration(self.user_1_id, self.EXP_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))
    exploration_mappings = user_models.PendingDeletionRequestModel.get_by_id(self.user_1_id).pseudonymizable_entity_mappings[models.NAMES.exploration]
    metadata_model = exp_models.ExplorationSnapshotMetadataModel.get_by_id(('%s-1' % self.EXP_1_ID))
    self.assertEqual(metadata_model.committer_id, exploration_mappings[self.EXP_1_ID])
    commit_log_model = exp_models.ExplorationCommitLogEntryModel.get_by_id(('exploration-%s-1' % self.EXP_1_ID))
    self.assertEqual(commit_log_model.user_id, exploration_mappings[self.EXP_1_ID])
    metadata_model = exp_models.ExplorationSnapshotMetadataModel.get_by_id(('%s-1' % self.EXP_2_ID))
    self.assertEqual(metadata_model.committer_id, exploration_mappings[self.EXP_2_ID])
    commit_log_model = exp_models.ExplorationCommitLogEntryModel.get_by_id(('exploration-%s-1' % self.EXP_2_ID))
    self.assertEqual(commit_log_model.user_id, exploration_mappings[self.EXP_2_ID])
def test_multiple_explorations_are_pseudonymized(self):
    self.save_new_valid_exploration(self.EXP_2_ID, self.user_1_id)
    self.publish_exploration(self.user_1_id, self.EXP_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))
    exploration_mappings = user_models.PendingDeletionRequestModel.get_by_id(self.user_1_id).pseudonymizable_entity_mappings[models.NAMES.exploration]
    metadata_model = exp_models.ExplorationSnapshotMetadataModel.get_by_id(('%s-1' % self.EXP_1_ID))
    self.assertEqual(metadata_model.committer_id, exploration_mappings[self.EXP_1_ID])
    commit_log_model = exp_models.ExplorationCommitLogEntryModel.get_by_id(('exploration-%s-1' % self.EXP_1_ID))
    self.assertEqual(commit_log_model.user_id, exploration_mappings[self.EXP_1_ID])
    metadata_model = exp_models.ExplorationSnapshotMetadataModel.get_by_id(('%s-1' % self.EXP_2_ID))
    self.assertEqual(metadata_model.committer_id, exploration_mappings[self.EXP_2_ID])
    commit_log_model = exp_models.ExplorationCommitLogEntryModel.get_by_id(('exploration-%s-1' % self.EXP_2_ID))
    self.assertEqual(commit_log_model.user_id, exploration_mappings[self.EXP_2_ID])