'Test a course whose structure is not a tree.'

@patch('xmodule.modulestore.xml.log')
def test_dag_course(self, mock_logging):

    store = XMLModuleStore(DATA_DIR, source_dirs=['xml_dag'], xblock_mixins=(XModuleMixin,))
    course_key = store.get_courses()[0].id
    mock_logging.warning.assert_called_with('%s    has    more    than    one    definition', course_key.make_usage_key('discussion', 'duplicate_def'))
    shared_item_loc = course_key.make_usage_key('html', 'toyhtml')
    shared_item = store.get_item(shared_item_loc)
    parent = shared_item.get_parent()
    self.assertIsNotNone(parent, 'get_parent    failed    to    return    a    value')
    parent_loc = course_key.make_usage_key('vertical', 'vertical_test')
    self.assertEqual(parent.location, parent_loc)
    self.assertIn(shared_item, parent.get_children())
    other_parent_loc = course_key.make_usage_key('vertical', 'zeta')
    other_parent = store.get_item(other_parent_loc)
    self.assertIn(shared_item_loc, other_parent.children)
