This test is specifically verifying the Textbook type tabs.  So we ignore
the other tabs.

But I see what you're saying.  I have added an assert to make sure the
generator returns the expected number of textbooks as was set up in the
setUp method.


On Thu, Mar 20, 2014 at 11:31 AM, David Baumgold
<notifications@github.com>wrote:

> In common/lib/xmodule/xmodule/tests/test_tabs.py:
>
> > +        self.course.html_textbooks = books
> > +        self.course.tabs = [
> > +            tabs.CoursewareTab(),
> > +            tabs.CourseInfoTab(),
> > +            tabs.TextbookTabs(),
> > +            tabs.PDFTextbookTabs(),
> > +            tabs.HtmlTextbookTabs(),
> > +        ]
> > +
> > +    def test_textbooks_enabled(self):
> > +
> > +        type_to_reverse_name = {'textbook': 'book', 'pdftextbook': 'pdf_book', 'htmltextbook': 'html_book'}
> > +
> > +        self.settings.FEATURES['ENABLE_TEXTBOOK'] = True
> > +        for tab in tabs.CourseTabList.iterate_displayable(self.course, self.settings):
> > +            if isinstance(tab, tabs.SingleTextbookTab):
>
> Can you also assert on the output of CourseTabList.iterate_displayable?
> If none of the tabs are instances of tabs.SingleTextbookTab, this test
> doesn't have any assertions, which means that the test will pass -- even
> though it sounds like that's not what you want. (Or is it?)
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/edx/edx-platform/pull/2910/files#r10799850>
> .
>



-- 

edX | nasthagiri@edx.org <andya@edx.org>

141 Portland Street, 9th floor

Cambridge, MA 02139
http://www.edx.org <http://www.edxonline.org/>

[image:
http://www.e-learn.nl/media/blogs/e-learn/edX_Logo_Col_RGB_FINAL.jpg?mtime=1336074566]