def test_one_topic_snapshot_content_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]
    rights_content_model_1 = topic_models.TopicRightsSnapshotContentModel.get_by_id(('%s-1' % self.TOP_1_ID))
    self.assertEqual(rights_content_model_1.content['manager_ids'], [])
    rights_content_model_2 = topic_models.TopicRightsSnapshotContentModel.get_by_id(('%s-3' % self.TOP_1_ID))
    self.assertItemsEqual(rights_content_model_2.content['manager_ids'], [topic_mappings[self.TOP_1_ID], self.user_2_id])
def test_one_topic_snapshot_content_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]
    rights_content_model_1 = topic_models.TopicRightsSnapshotContentModel.get_by_id(('%s-1' % self.TOP_1_ID))
    self.assertEqual(rights_content_model_1.content['manager_ids'], [])
    rights_content_model_2 = topic_models.TopicRightsSnapshotContentModel.get_by_id(('%s-3' % self.TOP_1_ID))
    self.assertItemsEqual(rights_content_model_2.content['manager_ids'], [topic_mappings[self.TOP_1_ID], self.user_2_id])