diff --git a/test_secretary.py b/test_secretary.py index 9a5d629..9e21bca 100644 --- a/test_secretary.py +++ b/test_secretary.py @@ -18,6 +18,7 @@ def test_pad_string(): assert pad_string('TEST', 4) == 'TEST' assert pad_string(1) == '00001' + class RenderTestCase(TestCase): def setUp(self): root = os.path.dirname(__file__) @@ -63,7 +64,6 @@ class RenderTestCase(TestCase): for test, expect in test_samples.items(): assert self.engine._encode_escape_chars(test) == expect - def _test_is_jinja_tag(self): assert self._is_jinja_tag('{{ foo }}')==True assert self._is_jinja_tag('{ foo }')==False @@ -79,3 +79,12 @@ class RenderTestCase(TestCase): def test_create_text_span_node(self): assert self.engine.create_text_span_node(self.document, 'text').toxml() == 'text' + def test_newline(self): + xml_text = 'Teststraße 5\n1234 Lünen' + result = Renderer._encode_escape_chars(xml_text) + assert result == 'Teststraße 51234 Lünen' + + def test_evil_newline(self): + xml_text = '\n\n' + result = Renderer._encode_escape_chars(xml_text) + assert result == '\n'