'Test the various calling forms for get_course'

@patch('xmodule.tabs.CourseTab.from_json', side_effect=mock_tab_from_json)
def test_get_course(self, _from_json):

    locator = CourseLocator(org='testx', course='GreekHero', run='run', branch=BRANCH_NAME_DRAFT)
    head_course = modulestore().get_course(locator)
    self.assertNotEqual(head_course.location.version_guid, head_course.previous_version)
    locator = CourseLocator(version_guid=head_course.previous_version)
    course = modulestore().get_course(locator)
    self.assertIsNone(course.location.course_key.org)
    self.assertEqual(course.location.version_guid, head_course.previous_version)
    self.assertEqual(course.category, 'course')
    self.assertEqual(len(course.tabs), 6)
    self.assertEqual(course.display_name, 'The    Ancient    Greek    Hero')
    self.assertEqual(course.graceperiod, datetime.timedelta(hours=2))
    self.assertIsNone(course.advertised_start)
    self.assertEqual(len(course.children), 0)
    self.assertNotEqual(course.definition_locator.definition_id, head_course.definition_locator.definition_id)
    self.assertEqual(course.edited_by, 'testassist@edx.org')
    self.assertDictEqual(course.grade_cutoffs, {'Pass': 0.55})
    locator = CourseLocator(org='testx', course='GreekHero', run='run', branch=BRANCH_NAME_DRAFT)
    course = modulestore().get_course(locator)
    self.assertEqual(course.location.course_key.org, 'testx')
    self.assertEqual(course.location.course_key.course, 'GreekHero')
    self.assertEqual(course.location.course_key.run, 'run')
    self.assertEqual(course.category, 'course')
    self.assertEqual(len(course.tabs), 6)
    self.assertEqual(course.display_name, 'The    Ancient    Greek    Hero')
    self.assertEqual(course.advertised_start, 'Fall    2013')
    self.assertEqual(len(course.children), 4)
    self.assertEqual(course.edited_by, 'testassist@edx.org')
    self.assertDictEqual(course.grade_cutoffs, {'Pass': 0.45})
    locator = CourseLocator(org='testx', course='wonderful', run='run', branch=BRANCH_NAME_PUBLISHED)
    course = modulestore().get_course(locator)
    published_version = course.location.version_guid
    locator = CourseLocator(org='testx', course='wonderful', run='run', branch=BRANCH_NAME_DRAFT)
    course = modulestore().get_course(locator)
    self.assertNotEqual(course.location.version_guid, published_version)
