def test_contributors_for_valid_nonrevert_contribution(self):
    exploration = self.save_new_valid_exploration(self.EXP_ID, self.user_a_id)
    collection = self.save_new_valid_collection(self.COL_ID, self.user_a_id)
    exp_services.update_exploration(self.user_a_id, self.EXP_ID, [exp_domain.ExplorationChange({'cmd': 'edit_exploration_property', 'property_name': 'title', 'new_value': 'New Exploration Title'})], 'Changed title.')
    exp_services.update_exploration(self.user_a_id, self.EXP_ID, [exp_domain.ExplorationChange({'cmd': 'edit_exploration_property', 'property_name': 'objective', 'new_value': 'New Objective'})], 'Changed Objective.')
    collection_services.update_collection(self.user_a_id, self.COL_ID, [{'cmd': 'edit_collection_property', 'property_name': 'title', 'new_value': 'New Exploration Title'}], 'Changed title.')
    collection_services.update_collection(self.user_a_id, self.COL_ID, [{'cmd': 'edit_collection_property', 'property_name': 'objective', 'new_value': 'New Objective'}], 'Changed Objective.')
    output = self._run_one_off_job()
    self.assertEqual([['SUCCESS', 3]], output)
    exploration_summary = exp_fetchers.get_exploration_summary_by_id(exploration.id)
    self.assertEqual([self.user_a_id], exploration_summary.contributor_ids)
    self.assertEqual({self.user_a_id: 3}, exploration_summary.contributors_summary)
    collection_summary = collection_services.get_collection_summary_by_id(collection.id)
    self.assertEqual([self.user_a_id], collection_summary.contributor_ids)
    self.assertEqual({self.user_a_id: 3}, collection_summary.contributors_summary)
def test_contributors_for_valid_nonrevert_contribution(self):
    exploration = self.save_new_valid_exploration(self.EXP_ID, self.user_a_id)
    collection = self.save_new_valid_collection(self.COL_ID, self.user_a_id)
    exp_services.update_exploration(self.user_a_id, self.EXP_ID, [exp_domain.ExplorationChange({'cmd': 'edit_exploration_property', 'property_name': 'title', 'new_value': 'New Exploration Title'})], 'Changed title.')
    exp_services.update_exploration(self.user_a_id, self.EXP_ID, [exp_domain.ExplorationChange({'cmd': 'edit_exploration_property', 'property_name': 'objective', 'new_value': 'New Objective'})], 'Changed Objective.')
    collection_services.update_collection(self.user_a_id, self.COL_ID, [{'cmd': 'edit_collection_property', 'property_name': 'title', 'new_value': 'New Exploration Title'}], 'Changed title.')
    collection_services.update_collection(self.user_a_id, self.COL_ID, [{'cmd': 'edit_collection_property', 'property_name': 'objective', 'new_value': 'New Objective'}], 'Changed Objective.')
    output = self._run_one_off_job()
    self.assertEqual([['SUCCESS', 3]], output)
    exploration_summary = exp_fetchers.get_exploration_summary_by_id(exploration.id)
    self.assertEqual([self.user_a_id], exploration_summary.contributor_ids)
    self.assertEqual({self.user_a_id: 3}, exploration_summary.contributors_summary)
    collection_summary = collection_services.get_collection_summary_by_id(collection.id)
    self.assertEqual([self.user_a_id], collection_summary.contributor_ids)
    self.assertEqual({self.user_a_id: 3}, collection_summary.contributors_summary)