diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/sleektest.py | 13 | ||||
-rw-r--r-- | tests/test_elementbase.py | 4 |
2 files changed, 14 insertions, 3 deletions
diff --git a/tests/sleektest.py b/tests/sleektest.py index 801253d3..66535bcb 100644 --- a/tests/sleektest.py +++ b/tests/sleektest.py @@ -504,7 +504,18 @@ class SleekTest(unittest.TestCase): if xml.attrib != other.attrib: return False - # Step 3: Recursively check children + # Step 3: Check text + if xml.text is None: + xml.text = "" + if other.text is None: + other.text = "" + xml.text = xml.text.strip() + other.text = other.text.strip() + + if xml.text != other.text: + return False + + # Step 4: Recursively check children for child in xml: child2s = other.findall("%s" % child.tag) if child2s is None: diff --git a/tests/test_elementbase.py b/tests/test_elementbase.py index 8de7a169..b6d7c6f0 100644 --- a/tests/test_elementbase.py +++ b/tests/test_elementbase.py @@ -347,7 +347,7 @@ class TestElementBase(SleekTest): </wrapper> </foo> """) - stanza._setSubText('bar', text='', keep=True) + stanza._setSubText('wrapper/bar', text='', keep=True) self.checkStanza(TestStanza, stanza, """ <foo xmlns="foo"> <wrapper> @@ -358,7 +358,7 @@ class TestElementBase(SleekTest): """, use_values=False) stanza['bar'] = 'a' - stanza._setSubText('bar', text='') + stanza._setSubText('wrapper/bar', text='') self.checkStanza(TestStanza, stanza, """ <foo xmlns="foo"> <wrapper> |