summaryrefslogtreecommitdiff
path: root/tests/test_tostring.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2010-12-13 14:36:53 -0500
committerLance Stout <lancestout@gmail.com>2010-12-13 14:36:53 -0500
commitc16913c99929a6a5a57611ec8a1757e3e82d4a45 (patch)
treed92b98975b3dc012c734997e6fddc0ac9e2b82d8 /tests/test_tostring.py
parent12b61365adbbc910841475ea3cf8204f26ccd9c7 (diff)
parentf4451fe6b72f7cfb9680ead7a608d5ca1bc7e753 (diff)
downloadslixmpp-c16913c99929a6a5a57611ec8a1757e3e82d4a45.tar.gz
slixmpp-c16913c99929a6a5a57611ec8a1757e3e82d4a45.tar.bz2
slixmpp-c16913c99929a6a5a57611ec8a1757e3e82d4a45.tar.xz
slixmpp-c16913c99929a6a5a57611ec8a1757e3e82d4a45.zip
Merge branch 'develop' into roster
Conflicts: sleekxmpp/basexmpp.py
Diffstat (limited to 'tests/test_tostring.py')
-rw-r--r--tests/test_tostring.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/test_tostring.py b/tests/test_tostring.py
index 3e9df524..638e613a 100644
--- a/tests/test_tostring.py
+++ b/tests/test_tostring.py
@@ -1,6 +1,6 @@
from sleekxmpp.test import *
from sleekxmpp.stanza import Message
-from sleekxmpp.xmlstream.stanzabase import ET
+from sleekxmpp.xmlstream.stanzabase import ET, ElementBase
from sleekxmpp.xmlstream.tostring import tostring, xml_escape
@@ -10,6 +10,9 @@ class TestToString(SleekTest):
Test the implementation of sleekxmpp.xmlstream.tostring
"""
+ def tearDown(self):
+ self.stream_close()
+
def tryTostring(self, original='', expected=None, message='', **kwargs):
"""
Compare the result of calling tostring against an
@@ -110,5 +113,18 @@ class TestToString(SleekTest):
self.failUnless(result == expected,
"Stanza Unicode handling is incorrect: %s" % result)
+ def testXMLLang(self):
+ """Test that serializing xml:lang works."""
+
+ self.stream_start()
+
+ msg = self.Message()
+ msg._set_attr('{%s}lang' % msg.xml_ns, "no")
+
+ expected = '<message xml:lang="no" />'
+ result = msg.__str__()
+ self.failUnless(expected == result,
+ "Serialization with xml:lang failed: %s" % result)
+
suite = unittest.TestLoader().loadTestsFromTestCase(TestToString)