'Verify the JSON responses returned for the course.
Arguments:
is_concise (Boolean) : If True, fetch concise version of course outline.'

@ddt.data(True, False)
def test_json_responses(self, is_concise):

    outline_url = reverse_course_url('course_handler', self.course.id)
    outline_url = ((outline_url + '?format=concise') if is_concise else outline_url)
    resp = self.client.get(outline_url, HTTP_ACCEPT='application/json')
    json_response = json.loads(resp.content)
    self.assertEqual(json_response['category'], 'course')
    self.assertEqual(json_response['id'], unicode(self.course.location))
    self.assertEqual(json_response['display_name'], self.course.display_name)
    self.assertNotEqual(json_response.get('published', False), is_concise)
    self.assertIsNone(json_response.get('visibility_state'))
    children = json_response['child_info']['children']
    self.assertGreater(len(children), 0)
    first_child_response = children[0]
    self.assertEqual(first_child_response['category'], 'chapter')
    self.assertEqual(first_child_response['id'], unicode(self.chapter.location))
    self.assertEqual(first_child_response['display_name'], 'Week    1')
    self.assertNotEqual(json_response.get('published', False), is_concise)
    if (not is_concise):
        self.assertEqual(first_child_response['visibility_state'], VisibilityState.unscheduled)
    self.assertGreater(len(first_child_response['child_info']['children']), 0)
    self.assert_correct_json_response(json_response, is_concise)
