

def test_can_see_feedback_thread_counts(self):
    self.save_new_default_exploration(self.EXP_ID, self.owner_id, title=self.EXP_TITLE)
    self.login(self.OWNER_EMAIL)
    response = self.get_json(self.MY_EXPLORATIONS_DATA_URL)
    self.assertEqual(len(response['explorations_list']), 1)
    self.assertEqual(response['explorations_list'][0]['num_open_threads'], 0)
    self.assertEqual(response['explorations_list'][0]['num_total_threads'], 0)

    def mock_get_thread_analytics(unused_exploration_id):
        return feedback_domain.FeedbackAnalytics(self.EXP_ID, 2, 3)
    with self.swap(feedback_services, 'get_thread_analytics', mock_get_thread_analytics):
        response = self.get_json(self.MY_EXPLORATIONS_DATA_URL)
        self.assertEqual(len(response['explorations_list']), 1)
        self.assertEqual(response['explorations_list'][0]['num_open_threads'], 2)
        self.assertEqual(response['explorations_list'][0]['num_total_threads'], 3)
    self.logout()

dataset/ETHPy150Open oppia/oppia/core/controllers/home_test.py MyExplorationsHandlerTest.test_can_see_feedback_thread_counts/original