Skip to content

Commit

Permalink
Add test for entity escaping roundtrip in regular DTD
Browse files Browse the repository at this point in the history
  • Loading branch information
unho committed Feb 27, 2013
1 parent 7491791 commit 57b25f5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions translate/storage/test_dtd.py
Expand Up @@ -304,3 +304,16 @@ def test_entity_escaping(self):
# "between <p> and </p> tags.")
#assert dtdunit.source == ("In HTML the text paragraphs are enclosed "
# "between <p> and </p> tags.")

# Test for bug #68
def test_entity_escaping_roundtrip(self):
"""Test entities escaping roundtrip (&amp; &quot; ...) (bug #68)"""
dtdsource = ('<!ENTITY securityView.privacy.header "Privacy &amp; '
'History">\n<!ENTITY rights.safebrowsing-term3 "Uncheck '
'the options to &quot;&blockAttackSites.label;&quot; and '
'&quot;&blockWebForgeries.label;&quot;">\n<!ENTITY '
'translate.test1 \'XML encodings don&apos;t work\'>\n'
'<!ENTITY translate.test2 "In HTML the text paragraphs '
'are enclosed between &lt;p&gt; and &lt;/p&gt; tags.">\n')
dtdregen = self.dtdregen(dtdsource)
assert dtdsource == dtdregen

0 comments on commit 57b25f5

Please sign in to comment.