diff --git a/cms/djangoapps/contentstore/views/tests/test_tabs.py b/cms/djangoapps/contentstore/views/tests/test_tabs.py index c9d930a1cd..921e9564ab 100644 --- a/cms/djangoapps/contentstore/views/tests/test_tabs.py +++ b/cms/djangoapps/contentstore/views/tests/test_tabs.py @@ -71,7 +71,7 @@ class TabsPageTests(CourseTestCase): resp = self.client.get_html(self.url) self.assertEqual(resp.status_code, 200) - self.assertIn('course-nav-list', resp.content) + self.assertIn('course-nav-list', resp.content.decode('utf-8')) def test_reorder_tabs(self): """Test re-ordering of tabs""" diff --git a/common/lib/xmodule/xmodule/tabs.py b/common/lib/xmodule/xmodule/tabs.py index 253e6d640b..18f9166dd0 100644 --- a/common/lib/xmodule/xmodule/tabs.py +++ b/common/lib/xmodule/xmodule/tabs.py @@ -172,6 +172,10 @@ class CourseTab(six.with_metaclass(ABCMeta, object)): """ return not self == other + def __hash__(self): + """ Return a hash representation of Tab Object. """ + return hash(repr(self)) + @classmethod def validate(cls, tab_dict, raise_error=True): """ @@ -294,6 +298,10 @@ class TabFragmentViewMixin(object): """ return self.fragment_view.render_to_fragment(request, course_id=six.text_type(course.id), **kwargs) + def __hash__(self): + """ Return a hash representation of Tab Object. """ + return hash(repr(self)) + class StaticTab(CourseTab): """ @@ -359,6 +367,10 @@ class StaticTab(CourseTab): return False return self.url_slug == other.get('url_slug') + def __hash__(self): + """ Return a hash representation of Tab Object. """ + return hash(repr(self)) + class CourseTabList(List): """