def test_collection_user_is_removed_from_contributors(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 = collection_models.CollectionSummaryModel.get_by_id(self.COL_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 = {self.user_1_id: 2}
    old_summary_model.put()
    wipeout_service.delete_user(wipeout_service.get_pending_deletion_request(self.user_1_id))
    new_summary_model = collection_models.CollectionSummaryModel.get_by_id(self.COL_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_collection_user_is_removed_from_contributors(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 = collection_models.CollectionSummaryModel.get_by_id(self.COL_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 = {self.user_1_id: 2}
    old_summary_model.put()
    wipeout_service.delete_user(wipeout_service.get_pending_deletion_request(self.user_1_id))
    new_summary_model = collection_models.CollectionSummaryModel.get_by_id(self.COL_1_ID)
    self.assertNotIn(self.user_1_id, new_summary_model.contributor_ids)
    self.assertNotIn(self.user_1_id, new_summary_model.contributors_summary)