Example #1
0
    def test_show_contact(self):
        request = self.create_dummy()
        builder = self.stub()
        self.expect(builder.add_file('logo.pdf', data=ANY))

        self.replay()

        layout = LandscapeLayout(self.context, request, builder)

        self.assertEqual(layout.get_render_arguments()['show_contact'], False)
    def test_show_contact(self):
        request = self.create_dummy()
        builder = self.stub()
        self.expect(builder.add_file('logo.pdf', data=ANY))

        self.replay()

        layout = LandscapeLayout(self.context, request, builder)

        self.assertEqual(layout.get_render_arguments()['show_contact'],
                         False)
    def test_rendering(self):
        request = self.create_dummy()
        builder = self.stub()
        self.expect(builder.add_file('logo.pdf', data=ANY))

        self.replay()
        layout = LandscapeLayout(self.context, request, builder)

        latex = layout.render_latex('CONTENT LATEX')
        self.assertIn('CONTENT LATEX', latex)
        self.assertIn(layout.get_packages_latex(), latex)
        self.assertNotIn(r'T direkt ', latex)
        self.assertNotIn(r'\phantom{foo}\vspace{-2\baselineskip}', latex)
Example #4
0
    def test_rendering(self):
        request = self.create_dummy()
        builder = self.stub()
        self.expect(builder.add_file('logo.pdf', data=ANY))

        self.replay()
        layout = LandscapeLayout(self.context, request, builder)

        latex = layout.render_latex('CONTENT LATEX')
        self.assertIn('CONTENT LATEX', latex)
        self.assertIn(layout.get_packages_latex(), latex)
        self.assertNotIn(r'T direkt ', latex)
        self.assertNotIn(r'\phantom{foo}\vspace{-2\baselineskip}', latex)
    def test_box_sizes_and_positions(self):
        request = self.create_dummy()
        builder = self.stub()
        self.expect(builder.add_file('logo.pdf', data=ANY))

        self.replay()
        layout = LandscapeLayout(self.context, request, builder)
        layout.show_contact = True
        layout.show_organisation = True

        latex = layout.render_latex('LATEX CONTENT')
        self.assertIn(r'begin{textblock}{58mm\TPHorizModule} '
                      r'(220mm\TPHorizModule',
                      latex)

        self.assertIn(r'\begin{textblock}{58mm\TPHorizModule}'
                      r' (220mm\TPHorizModule, 54mm\TPVertModule)',
                      latex)
Example #6
0
    def test_box_sizes_and_positions(self):
        request = self.create_dummy()
        builder = self.stub()
        self.expect(builder.add_file('logo.pdf', data=ANY))

        self.replay()
        layout = LandscapeLayout(self.context, request, builder)
        layout.show_contact = True
        layout.show_organisation = True

        latex = layout.render_latex('LATEX CONTENT')
        self.assertIn(
            r'begin{textblock}{58mm\TPHorizModule} '
            r'(220mm\TPHorizModule', latex)

        self.assertIn(
            r'\begin{textblock}{58mm\TPHorizModule}'
            r' (220mm\TPHorizModule, 54mm\TPVertModule)', latex)