'Test reordering children that can be in the draft store.'

def test_reorder_children(self):

    unit_1_resp = self.create_xblock(parent_usage_key=self.seq_usage_key, category='vertical')
    unit_2_resp = self.create_xblock(parent_usage_key=self.seq_usage_key, category='vertical')
    unit1_usage_key = self.response_usage_key(unit_1_resp)
    unit2_usage_key = self.response_usage_key(unit_2_resp)
    children = self.get_item_from_modulestore(self.seq_usage_key).children
    self.assertEqual(unit1_usage_key, children[1])
    self.assertEqual(unit2_usage_key, children[2])
    resp = self.client.ajax_post(self.seq_update_url, data={'children': [unicode(self.problem_usage_key), unicode(unit2_usage_key), unicode(unit1_usage_key)]})
    self.assertEqual(resp.status_code, 200)
    children = self.get_item_from_modulestore(self.seq_usage_key).children
    self.assertEqual(self.problem_usage_key, children[0])
    self.assertEqual(unit1_usage_key, children[2])
    self.assertEqual(unit2_usage_key, children[1])
