diff options
Diffstat (limited to 'tests/test_tostring.py')
-rw-r--r-- | tests/test_tostring.py | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/tests/test_tostring.py b/tests/test_tostring.py index e456d28e..e6148533 100644 --- a/tests/test_tostring.py +++ b/tests/test_tostring.py @@ -1,7 +1,7 @@ -from sleekxmpp.test import * -from sleekxmpp.stanza import Message -from sleekxmpp.xmlstream.stanzabase import ET, ElementBase -from sleekxmpp.xmlstream.tostring import tostring, xml_escape +import unittest +from sleekxmpp.test import SleekTest +from sleekxmpp.xmlstream.stanzabase import ET +from sleekxmpp.xmlstream.tostring import tostring, escape class TestToString(SleekTest): @@ -30,7 +30,7 @@ class TestToString(SleekTest): def testXMLEscape(self): """Test escaping XML special characters.""" original = """<foo bar="baz">'Hi & welcome!'</foo>""" - escaped = xml_escape(original) + escaped = escape(original) desired = """<foo bar="baz">'Hi""" desired += """ & welcome!'</foo>""" @@ -85,19 +85,6 @@ class TestToString(SleekTest): original='<a>foo <b>bar</b> baz</a>', message='Element tail content is incorrect.') - - def testStanzaNs(self): - """ - Test using the stanza_ns tostring parameter, which will prevent - adding an xmlns attribute to the serialized element if the - element's namespace is the same. - """ - self.tryTostring( - original='<bar xmlns="foo" />', - expected='<bar />', - message="The stanza_ns parameter was not used properly.", - stanza_ns='foo') - def testStanzaStr(self): """ Test that stanza objects are serialized properly. |