예제 #1
0
    def test_title_is_inserted_literally(self):
        # The spinx layout expects the title to not be LaTeX, but the string
        # literal.

        self._mock_portal_languages_tool()
        book = self._mock_book({'Title': 'Foo-Bar'})
        self.replay()

        layout = DefaultBookLayout(book, object(), object())

        self.assertEqual('Foo-Bar', layout.get_render_arguments()['title'])
예제 #2
0
    def test_title_is_inserted_literally(self):
        # The spinx layout expects the title to not be LaTeX, but the string
        # literal.

        self._mock_portal_languages_tool()
        book = self._mock_book({'Title': 'Foo-Bar'})
        self.replay()

        layout = DefaultBookLayout(book, object(), object())

        self.assertEqual('Foo-Bar', layout.get_render_arguments()['title'])
예제 #3
0
    def test_get_render_arguments_babel(self):
        book = self._mock_book()

        language_tool = self.mocker.mock()
        self.mock_tool(language_tool, 'portal_languages')
        self.expect(language_tool.getPreferredLanguage()).result('de')

        self.replay()

        layout = DefaultBookLayout(book, object(), object())

        self.assertEqual(layout.get_render_arguments()['babel'], 'ngerman')
예제 #4
0
    def test_get_render_arguments_babel(self):
        book = self._mock_book()

        language_tool = self.stub()
        self.mock_tool(language_tool, 'portal_languages')
        self.expect(language_tool.getPreferredLanguage()).result('de')

        self.replay()

        layout = DefaultBookLayout(book, object(), object())

        self.assertEqual(layout.get_render_arguments()['babel'], 'ngerman')
예제 #5
0
    def test_get_render_arguments(self):
        self._mock_portal_languages_tool()
        book = self._mock_book()
        self.replay()

        layout = DefaultBookLayout(book, object(), object())

        self.assertEqual(
            layout.get_render_arguments(),
            {'context_is_book': True,
             'title': 'My book',
             'use_titlepage': True,
             'use_toc': True,
             'use_lot': True,
             'use_loi': True,
             'authoraddress': r'Bern\\Switzerland',
             'author': '4teamwork',
             'release': '2.5',
             'babel': 'english',
             'logo': False,
             'logo_width': 0})
예제 #6
0
    def test_get_render_arguments(self):
        self._mock_portal_languages_tool()
        book = self._mock_book()
        self.replay()

        layout = DefaultBookLayout(book, object(), object())

        self.assertEqual(
            layout.get_render_arguments(), {
                'context_is_book': True,
                'title': 'My book',
                'use_titlepage': True,
                'use_toc': True,
                'use_lot': True,
                'use_loi': True,
                'use_index': False,
                'index_title': u'Index',
                'authoraddress': r'Bern\\Switzerland',
                'author': '4teamwork',
                'release': '2.5',
                'babel': 'english',
                'logo': False,
                'logo_width': 0
            })