def test_one_story_with_multiple_users_is_pseudonymized(self):
    story_services.update_story(self.user_2_id, self.STORY_1_ID, [story_domain.StoryChange({'cmd': story_domain.CMD_ADD_STORY_NODE, 'node_id': 'node_1', 'title': 'Title 2'})], 'Add node.')
    wipeout_service.delete_user(wipeout_service.get_pending_deletion_request(self.user_1_id))
    story_mappings_1 = user_models.PendingDeletionRequestModel.get_by_id(self.user_1_id).pseudonymizable_entity_mappings[models.NAMES.story]
    metadata_model = story_models.StorySnapshotMetadataModel.get_by_id(('%s-1' % self.STORY_1_ID))
    self.assertEqual(metadata_model.committer_id, story_mappings_1[self.STORY_1_ID])
    commit_log_model = story_models.StoryCommitLogEntryModel.get_by_id(('story-%s-1' % self.STORY_1_ID))
    self.assertEqual(commit_log_model.user_id, story_mappings_1[self.STORY_1_ID])
    metadata_model = story_models.StorySnapshotMetadataModel.get_by_id(('%s-2' % self.STORY_1_ID))
    self.assertEqual(metadata_model.committer_id, self.user_2_id)
    commit_log_model = story_models.StoryCommitLogEntryModel.get_by_id(('story-%s-2' % self.STORY_1_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))
    story_mappings_2 = user_models.PendingDeletionRequestModel.get_by_id(self.user_2_id).pseudonymizable_entity_mappings[models.NAMES.story]
    metadata_model = story_models.StorySnapshotMetadataModel.get_by_id(('%s-2' % self.STORY_1_ID))
    self.assertEqual(metadata_model.committer_id, story_mappings_2[self.STORY_1_ID])
    commit_log_model = story_models.StoryCommitLogEntryModel.get_by_id(('story-%s-2' % self.STORY_1_ID))
    self.assertEqual(commit_log_model.user_id, story_mappings_2[self.STORY_1_ID])
def test_one_story_with_multiple_users_is_pseudonymized(self):
    story_services.update_story(self.user_2_id, self.STORY_1_ID, [story_domain.StoryChange({'cmd': story_domain.CMD_ADD_STORY_NODE, 'node_id': 'node_1', 'title': 'Title 2'})], 'Add node.')
    wipeout_service.delete_user(wipeout_service.get_pending_deletion_request(self.user_1_id))
    story_mappings_1 = user_models.PendingDeletionRequestModel.get_by_id(self.user_1_id).pseudonymizable_entity_mappings[models.NAMES.story]
    metadata_model = story_models.StorySnapshotMetadataModel.get_by_id(('%s-1' % self.STORY_1_ID))
    self.assertEqual(metadata_model.committer_id, story_mappings_1[self.STORY_1_ID])
    commit_log_model = story_models.StoryCommitLogEntryModel.get_by_id(('story-%s-1' % self.STORY_1_ID))
    self.assertEqual(commit_log_model.user_id, story_mappings_1[self.STORY_1_ID])
    metadata_model = story_models.StorySnapshotMetadataModel.get_by_id(('%s-2' % self.STORY_1_ID))
    self.assertEqual(metadata_model.committer_id, self.user_2_id)
    commit_log_model = story_models.StoryCommitLogEntryModel.get_by_id(('story-%s-2' % self.STORY_1_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))
    story_mappings_2 = user_models.PendingDeletionRequestModel.get_by_id(self.user_2_id).pseudonymizable_entity_mappings[models.NAMES.story]
    metadata_model = story_models.StorySnapshotMetadataModel.get_by_id(('%s-2' % self.STORY_1_ID))
    self.assertEqual(metadata_model.committer_id, story_mappings_2[self.STORY_1_ID])
    commit_log_model = story_models.StoryCommitLogEntryModel.get_by_id(('story-%s-2' % self.STORY_1_ID))
    self.assertEqual(commit_log_model.user_id, story_mappings_2[self.STORY_1_ID])