'Verify that get_course_view_types sorts appropriately'

@patch('openedx.core.lib.course_tabs.CourseTabPluginManager.get_available_plugins')
def test_get_tab_types(self, get_available_plugins):

    def create_mock_plugin(tab_type, priority):
        '    Create    a    mock    plugin    with    the    specified    name    and    priority.    '
        mock_plugin = Mock()
        mock_plugin.type = tab_type
        mock_plugin.priority = priority
        return mock_plugin
    mock_plugins = {'Last': create_mock_plugin(tab_type='Last', priority=None), 'Duplicate1': create_mock_plugin(tab_type='Duplicate', priority=None), 'Duplicate2': create_mock_plugin(tab_type='Duplicate', priority=None), 'First': create_mock_plugin(tab_type='First', priority=1), 'Second': create_mock_plugin(tab_type='Second', priority=1), 'Third': create_mock_plugin(tab_type='Third', priority=3)}
    get_available_plugins.return_value = mock_plugins
    self.assertEqual([plugin.type for plugin in CourseTabPluginManager.get_tab_types()], ['First', 'Second', 'Third', 'Duplicate', 'Duplicate', 'Last'])
