def test_multiple_skills_with_multiple_users_are_pseudonymized(self):
    self.save_new_skill(self.SKILL_2_ID, self.user_2_id)
    wipeout_service.delete_user(wipeout_service.get_pending_deletion_request(self.user_1_id))
    skill_mappings_1 = user_models.PendingDeletionRequestModel.get_by_id(self.user_1_id).pseudonymizable_entity_mappings[models.NAMES.skill]
    metadata_model = skill_models.SkillSnapshotMetadataModel.get_by_id(('%s-1' % self.SKILL_1_ID))
    self.assertEqual(metadata_model.committer_id, skill_mappings_1[self.SKILL_1_ID])
    commit_log_model = skill_models.SkillCommitLogEntryModel.get_by_id(('skill-%s-1' % self.SKILL_1_ID))
    self.assertEqual(commit_log_model.user_id, skill_mappings_1[self.SKILL_1_ID])
    metadata_model = skill_models.SkillSnapshotMetadataModel.get_by_id(('%s-1' % self.SKILL_2_ID))
    self.assertEqual(metadata_model.committer_id, self.user_2_id)
    commit_log_model = skill_models.SkillCommitLogEntryModel.get_by_id(('skill-%s-1' % self.SKILL_2_ID))
    self.assertEqual(commit_log_model.user_id, self.user_2_id)
    wipeout_service.delete_user(wipeout_service.get_pending_deletion_request(self.user_2_id))
    skill_mappings_2 = user_models.PendingDeletionRequestModel.get_by_id(self.user_2_id).pseudonymizable_entity_mappings[models.NAMES.skill]
    metadata_model = skill_models.SkillSnapshotMetadataModel.get_by_id(('%s-1' % self.SKILL_2_ID))
    self.assertEqual(metadata_model.committer_id, skill_mappings_2[self.SKILL_2_ID])
    commit_log_model = skill_models.SkillCommitLogEntryModel.get_by_id(('skill-%s-1' % self.SKILL_2_ID))
    self.assertEqual(commit_log_model.user_id, skill_mappings_2[self.SKILL_2_ID])
def test_multiple_skills_with_multiple_users_are_pseudonymized(self):
    self.save_new_skill(self.SKILL_2_ID, self.user_2_id)
    wipeout_service.delete_user(wipeout_service.get_pending_deletion_request(self.user_1_id))
    skill_mappings_1 = user_models.PendingDeletionRequestModel.get_by_id(self.user_1_id).pseudonymizable_entity_mappings[models.NAMES.skill]
    metadata_model = skill_models.SkillSnapshotMetadataModel.get_by_id(('%s-1' % self.SKILL_1_ID))
    self.assertEqual(metadata_model.committer_id, skill_mappings_1[self.SKILL_1_ID])
    commit_log_model = skill_models.SkillCommitLogEntryModel.get_by_id(('skill-%s-1' % self.SKILL_1_ID))
    self.assertEqual(commit_log_model.user_id, skill_mappings_1[self.SKILL_1_ID])
    metadata_model = skill_models.SkillSnapshotMetadataModel.get_by_id(('%s-1' % self.SKILL_2_ID))
    self.assertEqual(metadata_model.committer_id, self.user_2_id)
    commit_log_model = skill_models.SkillCommitLogEntryModel.get_by_id(('skill-%s-1' % self.SKILL_2_ID))
    self.assertEqual(commit_log_model.user_id, self.user_2_id)
    wipeout_service.delete_user(wipeout_service.get_pending_deletion_request(self.user_2_id))
    skill_mappings_2 = user_models.PendingDeletionRequestModel.get_by_id(self.user_2_id).pseudonymizable_entity_mappings[models.NAMES.skill]
    metadata_model = skill_models.SkillSnapshotMetadataModel.get_by_id(('%s-1' % self.SKILL_2_ID))
    self.assertEqual(metadata_model.committer_id, skill_mappings_2[self.SKILL_2_ID])
    commit_log_model = skill_models.SkillCommitLogEntryModel.get_by_id(('skill-%s-1' % self.SKILL_2_ID))
    self.assertEqual(commit_log_model.user_id, skill_mappings_2[self.SKILL_2_ID])