def test_exp_user_is_removed_from_contributor_ids_when_missing_from_summary(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))
    old_summary_model = exp_models.ExpSummaryModel.get_by_id(self.EXP_1_ID)
    self.assertNotIn(self.user_1_id, old_summary_model.contributor_ids)
    self.assertNotIn(self.user_1_id, old_summary_model.contributors_summary)
    old_summary_model.contributor_ids = [self.user_1_id]
    old_summary_model.contributors_summary = {}
    old_summary_model.put()
    wipeout_service.delete_user(wipeout_service.get_pending_deletion_request(self.user_1_id))
    new_summary_model = exp_models.ExpSummaryModel.get_by_id(self.EXP_1_ID)
    self.assertNotIn(self.user_1_id, new_summary_model.contributor_ids)
    self.assertNotIn(self.user_1_id, new_summary_model.contributors_summary)
def test_exp_user_is_removed_from_contributor_ids_when_missing_from_summary(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))
    old_summary_model = exp_models.ExpSummaryModel.get_by_id(self.EXP_1_ID)
    self.assertNotIn(self.user_1_id, old_summary_model.contributor_ids)
    self.assertNotIn(self.user_1_id, old_summary_model.contributors_summary)
    old_summary_model.contributor_ids = [self.user_1_id]
    old_summary_model.contributors_summary = {}
    old_summary_model.put()
    wipeout_service.delete_user(wipeout_service.get_pending_deletion_request(self.user_1_id))
    new_summary_model = exp_models.ExpSummaryModel.get_by_id(self.EXP_1_ID)
    self.assertNotIn(self.user_1_id, new_summary_model.contributor_ids)
    self.assertNotIn(self.user_1_id, new_summary_model.contributors_summary)