def test_box_sizes_and_positions(self): context = self.stub() request = self.create_dummy() builder = self.stub() self.expect(builder.add_file('logo.pdf', data=ANY)) member = self.stub() self.expect(context.Creator()).result('john.doe') self.expect(self.portal_membership.getMemberById('john.doe')).result( member) self.expect(member.getProperty('phone_number', ' ')).result( '012 345 6789') self.replay() layout = DefaultLayout(context, request, builder) layout.show_organisation = True latex = layout.render_latex('LATEX CONTENT') self.assertIn(r'\begin{textblock}{58mm\TPHorizModule} ' r'(136mm\TPHorizModule', latex) self.assertIn(r'\begin{textblock}{100mm\TPHorizModule} ' r'(100mm\TPHorizModule, 10mm\TPVertModule)', latex)
def test_box_sizes_and_positions(self): context = self.stub() request = self.create_dummy() builder = self.stub() self.expect(builder.add_file('logo.pdf', data=ANY)) member = self.stub() self.expect(context.Creator()).result('john.doe') self.expect( self.portal_membership.getMemberById('john.doe')).result(member) self.expect(member.getProperty('phone_number', ' ')).result('012 345 6789') self.replay() layout = DefaultLayout(context, request, builder) layout.show_organisation = True latex = layout.render_latex('LATEX CONTENT') self.assertIn( r'\begin{textblock}{58mm\TPHorizModule} ' r'(136mm\TPHorizModule', latex) self.assertIn( r'\begin{textblock}{100mm\TPHorizModule} ' r'(100mm\TPHorizModule, 10mm\TPVertModule)', latex)
def test_rendering(self): context = self.stub() request = self.create_dummy() builder = self.stub() self.expect(builder.add_file('logo.pdf', data=ANY)) member = self.stub() self.expect(context.Creator()).result('john.doe') self.expect(self.portal_membership.getMemberById('john.doe')).result( member) self.expect(member.getProperty('phone_number', ' ')).result( '012 345 6789') self.replay() layout = DefaultLayout(context, request, builder) latex = layout.render_latex('LATEX CONTENT') self.assertIn('LATEX CONTENT', latex) self.assertIn(layout.get_packages_latex(), latex) self.assertIn(r'\phantom{foo}\vspace{-2\baselineskip}', latex)
def test_rendering(self): context = self.stub() request = self.create_dummy() builder = self.stub() self.expect(builder.add_file('logo.pdf', data=ANY)) member = self.stub() self.expect(context.Creator()).result('john.doe') self.expect( self.portal_membership.getMemberById('john.doe')).result(member) self.expect(member.getProperty('phone_number', ' ')).result('012 345 6789') self.replay() layout = DefaultLayout(context, request, builder) latex = layout.render_latex('LATEX CONTENT') self.assertIn('LATEX CONTENT', latex) self.assertIn(layout.get_packages_latex(), latex) self.assertIn(r'\phantom{foo}\vspace{-2\baselineskip}', latex)