def test_multiple_feedbacks_are_pseudonymized(self):
    feedback_thread_models = []
    for i in python_utils.RANGE(self.NUMBER_OF_MODELS):
        feedback_thread_models.append(feedback_models.GeneralFeedbackThreadModel(id=('feedback-%s' % i), entity_type=feconf.ENTITY_TYPE_EXPLORATION, entity_id=self.EXP_1_ID, original_author_id=self.user_1_id, subject='Too short exploration', last_nonempty_message_text='Some text', last_nonempty_message_author_id=self.user_2_id))
    feedback_message_models = []
    for i in python_utils.RANGE(self.NUMBER_OF_MODELS):
        feedback_message_models.append(feedback_models.GeneralFeedbackMessageModel(id=('message-%s' % i), thread_id=('feedback-%s' % i), message_id=i, author_id=self.user_1_id, text='Some text'))
    base_models.BaseHumanMaintainedModel.put_multi_for_human((feedback_thread_models + feedback_message_models))
    wipeout_service.delete_user(wipeout_service.get_pending_deletion_request(self.user_1_id))
    feedback_mappings = user_models.PendingDeletionRequestModel.get_by_id(self.user_1_id).pseudonymizable_entity_mappings[models.NAMES.feedback]
    pseudonymized_feedback_thread_models = feedback_models.GeneralFeedbackThreadModel.get_multi([model.id for model in feedback_thread_models])
    for feedback_thread_model in pseudonymized_feedback_thread_models:
        self.assertEqual(feedback_thread_model.original_author_id, feedback_mappings[feedback_thread_model.id])
    pseudonymized_feedback_message_models = feedback_models.GeneralFeedbackMessageModel.get_multi([model.id for model in feedback_message_models])
    for feedback_message_model in pseudonymized_feedback_message_models:
        self.assertEqual(feedback_message_model.author_id, feedback_mappings[feedback_message_model.thread_id])
def test_multiple_feedbacks_are_pseudonymized(self):
    feedback_thread_models = []
    for i in python_utils.RANGE(self.NUMBER_OF_MODELS):
        feedback_thread_models.append(feedback_models.GeneralFeedbackThreadModel(id=('feedback-%s' % i), entity_type=feconf.ENTITY_TYPE_EXPLORATION, entity_id=self.EXP_1_ID, original_author_id=self.user_1_id, subject='Too short exploration', last_nonempty_message_text='Some text', last_nonempty_message_author_id=self.user_2_id))
    feedback_message_models = []
    for i in python_utils.RANGE(self.NUMBER_OF_MODELS):
        feedback_message_models.append(feedback_models.GeneralFeedbackMessageModel(id=('message-%s' % i), thread_id=('feedback-%s' % i), message_id=i, author_id=self.user_1_id, text='Some text'))
    base_models.BaseHumanMaintainedModel.put_multi_for_human((feedback_thread_models + feedback_message_models))
    wipeout_service.delete_user(wipeout_service.get_pending_deletion_request(self.user_1_id))
    feedback_mappings = user_models.PendingDeletionRequestModel.get_by_id(self.user_1_id).pseudonymizable_entity_mappings[models.NAMES.feedback]
    pseudonymized_feedback_thread_models = feedback_models.GeneralFeedbackThreadModel.get_multi([model.id for model in feedback_thread_models])
    for feedback_thread_model in pseudonymized_feedback_thread_models:
        self.assertEqual(feedback_thread_model.original_author_id, feedback_mappings[feedback_thread_model.id])
    pseudonymized_feedback_message_models = feedback_models.GeneralFeedbackMessageModel.get_multi([model.id for model in feedback_message_models])
    for feedback_message_model in pseudonymized_feedback_message_models:
        self.assertEqual(feedback_message_model.author_id, feedback_mappings[feedback_message_model.thread_id])