def generate(self, new_doc_name, gen_pdf=True): self._prepare_school_data() self.document.merge_rows('no', self.records_to_merge) self.document.merge(semester_no=self.program_semester, school_year=self.year, date=self.date) DocumentCreator.generate(self, new_doc_name, False) generated_file = path.join(self.output_directory, new_doc_name) RegisterCreator._merge_cells(generated_file, RegisterCreator.CELL_TO_MERGE_MARK) DocumentCreator.generate_pdf(generated_file, self.output_directory)
def test_pdf_is_properly_created(): DocumentCreator.generate_pdf('helper_files\\aneks_test.docx', 'helper_files') assert (path.exists('helper_files\\aneks_test.pdf'))