def test_one_topic_snapshot_metadata_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))
    topic_mappings = user_models.PendingDeletionRequestModel.get_by_id(self.user_1_id).pseudonymizable_entity_mappings[models.NAMES.topic]
    metadata_model = topic_models.TopicSnapshotMetadataModel.get_by_id(('%s-1' % self.TOP_1_ID))
    self.assertEqual(metadata_model.committer_id, topic_mappings[self.TOP_1_ID])
    rights_metadata_model_1 = topic_models.TopicRightsSnapshotMetadataModel.get_by_id(('%s-1' % self.TOP_1_ID))
    self.assertEqual(rights_metadata_model_1.committer_id, topic_mappings[self.TOP_1_ID])
    self.assertEqual(rights_metadata_model_1.content_user_ids, [])
    self.assertEqual(rights_metadata_model_1.commit_cmds_user_ids, [])
    rights_metadata_model_2 = topic_models.TopicRightsSnapshotMetadataModel.get_by_id(('%s-2' % self.TOP_1_ID))
    self.assertEqual(rights_metadata_model_2.committer_id, topic_mappings[self.TOP_1_ID])
    self.assertEqual(rights_metadata_model_2.content_user_ids, [topic_mappings[self.TOP_1_ID]])
    self.assertEqual(rights_metadata_model_2.commit_cmds_user_ids, [topic_mappings[self.TOP_1_ID]])
def test_one_topic_snapshot_metadata_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))
    topic_mappings = user_models.PendingDeletionRequestModel.get_by_id(self.user_1_id).pseudonymizable_entity_mappings[models.NAMES.topic]
    metadata_model = topic_models.TopicSnapshotMetadataModel.get_by_id(('%s-1' % self.TOP_1_ID))
    self.assertEqual(metadata_model.committer_id, topic_mappings[self.TOP_1_ID])
    rights_metadata_model_1 = topic_models.TopicRightsSnapshotMetadataModel.get_by_id(('%s-1' % self.TOP_1_ID))
    self.assertEqual(rights_metadata_model_1.committer_id, topic_mappings[self.TOP_1_ID])
    self.assertEqual(rights_metadata_model_1.content_user_ids, [])
    self.assertEqual(rights_metadata_model_1.commit_cmds_user_ids, [])
    rights_metadata_model_2 = topic_models.TopicRightsSnapshotMetadataModel.get_by_id(('%s-2' % self.TOP_1_ID))
    self.assertEqual(rights_metadata_model_2.committer_id, topic_mappings[self.TOP_1_ID])
    self.assertEqual(rights_metadata_model_2.content_user_ids, [topic_mappings[self.TOP_1_ID]])
    self.assertEqual(rights_metadata_model_2.commit_cmds_user_ids, [topic_mappings[self.TOP_1_ID]])