'Test that we add index values on nodes'

def test_nodes_have_indices(self):

    (nodes, relationships) = serialize_course(self.course.id)
    html_nodes = [node for node in nodes if (node[u'block_type'] == u'html')]
    self.assertEqual(len(html_nodes), 1)
    problem_nodes = [node for node in nodes if (node[u'block_type'] == u'problem')]
    self.assertEqual(len(problem_nodes), 1)
    html_node = html_nodes[0]
    problem_node = problem_nodes[0]
    self.assertEqual(html_node[u'index'], 0)
    self.assertEqual(problem_node[u'index'], 1)
