summaryrefslogtreecommitdiff
path: root/tests/test_apis.py
diff options
context:
space:
mode:
authorfacelessuser <faceless.shop@gmail.com>2018-10-09 08:54:09 -0600
committerWaylan Limberg <waylan.limberg@icloud.com>2018-10-09 11:15:46 -0400
commit042bd0b10ee3f334e385db7bde5c53d847549e38 (patch)
tree51db88563bd911a052d162166ff15b384cb75811 /tests/test_apis.py
parent908bd07618cec8b63a64f74e50dadb450715832b (diff)
downloadpython-markdown-042bd0b10ee3f334e385db7bde5c53d847549e38.tar.gz
Ensure block elements are defined per instance
Block level elements should be defined per instance, not as base class variables.
Diffstat (limited to 'tests/test_apis.py')
-rw-r--r--tests/test_apis.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_apis.py b/tests/test_apis.py
index 71a8555..20144e4 100644
--- a/tests/test_apis.py
+++ b/tests/test_apis.py
@@ -942,6 +942,18 @@ class TestEscapeAppend(unittest.TestCase):
self.assertEqual('|' not in md2.ESCAPED_CHARS, True)
+class TestBlockAppend(unittest.TestCase):
+ """ Tests block kHTML append. """
+
+ def testBlockAppend(self):
+ """ Test that appended escapes are only in the current instance. """
+ md = markdown.Markdown()
+ md.block_level_elements.append('test')
+ self.assertEqual('test' in md.block_level_elements, True)
+ md2 = markdown.Markdown()
+ self.assertEqual('test' not in md2.block_level_elements, True)
+
+
class TestAncestorExclusion(unittest.TestCase):
""" Tests exclusion of tags in ancestor list. """