summaryrefslogtreecommitdiff
path: root/tests.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2013-02-12 15:00:59 +0100
committerChristian Heimes <christian@cheimes.de>2013-02-12 15:00:59 +0100
commitc1be037e46ec1738c2f2a91b9d46ad05d847f77f (patch)
tree6fc1643e050105606ad4fb1c565821382fd3aefc /tests.py
parente2b6fcee0126c423fe98a81aee3cd5c7349fc43c (diff)
downloaddefusedxml-c1be037e46ec1738c2f2a91b9d46ad05d847f77f.tar.gz
fixed externel file ref test on Python 3.x
Diffstat (limited to 'tests.py')
-rw-r--r--tests.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests.py b/tests.py
index 922fffd..62d0d6c 100644
--- a/tests.py
+++ b/tests.py
@@ -116,7 +116,11 @@ class BaseTests(unittest.TestCase):
def test_external_file_ref(self):
content = self.get_content(self.xml_external_file)
- content = content.replace("/PATH/TO", HERE)
+ if isinstance(content, bytes):
+ here = HERE.encode(sys.getfilesystemencoding())
+ content = content.replace(b"/PATH/TO", here)
+ else:
+ content = content.replace("/PATH/TO", HERE)
self.assertRaises(self.external_ref_exception, self.parseString,
content, forbid_entities=False)