Files

13 lines
756 B
Python

from roborto_accounting.config import default_logo_path
from roborto_accounting.reporting.documents.theme import DocumentTheme
from reportlab.platypus import Paragraph
def test_shared_theme_generates_deterministic_a4_pdf(tmp_path):
logo=default_logo_path()
theme=DocumentTheme(logo);story=theme.header(["accounts@roborto.net"])+theme.heading("INVOICE")
story.append(Paragraph("Correct accounting content",theme.body))
first=theme.build(tmp_path/"first.pdf",story)
story2=theme.header(["accounts@roborto.net"])+theme.heading("INVOICE")+[Paragraph("Correct accounting content",theme.body)]
second=theme.build(tmp_path/"second.pdf",story2)
assert first.read_bytes().startswith(b"%PDF") and first.read_bytes()==second.read_bytes()