Skip to content

Commit c51d018

Browse files
committed
tests: read raw template string
1 parent 21aab02 commit c51d018

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

unittests/test_pdf_report_rendering.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,21 +192,20 @@ def test_long_unbroken_string_in_report_field(self):
192192
def test_report_base_css_has_overflow_wrap(self):
193193
"""The report base template must include overflow-wrap for text wrapping."""
194194
template = self.django_engine.get_template("report_base.html")
195-
# Render with minimal context to get the CSS
196-
html = template.render({"report_name": "Test"})
195+
source = template.template.source
197196

198-
self.assertIn("overflow-wrap: break-word", html)
197+
self.assertIn("overflow-wrap: break-word", source)
199198

200199
def test_report_base_css_styles_nested_pre(self):
201200
"""
202201
The report base CSS must style .report-field pre to prevent
203202
nested <pre> elements from breaking out of margins.
204203
"""
205204
template = self.django_engine.get_template("report_base.html")
206-
html = template.render({"report_name": "Test"})
205+
source = template.template.source
207206

208-
self.assertIn(".report-field pre", html)
209-
self.assertIn("overflow-wrap: break-word", html)
207+
self.assertIn(".report-field pre", source)
208+
self.assertIn("overflow-wrap: break-word", source)
210209

211210
def test_raw_request_pre_tags_preserved(self):
212211
"""

0 commit comments

Comments
 (0)