summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2010-12-07 23:07:40 -0500
committerLance Stout <lancestout@gmail.com>2010-12-07 23:07:40 -0500
commitf474d378efdc754b57dedd60a9905ac5e75ee55d (patch)
treeeba26755fdc0fb55ceddb0bde01fd5c77795775d /tests
parentdefc252c7dabb1d54fe20b3ac8661d0198ff40bd (diff)
downloadslixmpp-f474d378efdc754b57dedd60a9905ac5e75ee55d.tar.gz
slixmpp-f474d378efdc754b57dedd60a9905ac5e75ee55d.tar.bz2
slixmpp-f474d378efdc754b57dedd60a9905ac5e75ee55d.tar.xz
slixmpp-f474d378efdc754b57dedd60a9905ac5e75ee55d.zip
Add support for using xml:lang values.
Support is only for adding literal XML content to stanzas. Full support for things like multiple message bodies with different xml:lang values is still in the works.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_tostring.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/test_tostring.py b/tests/test_tostring.py
index 3e9df524..5235d53e 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
@@ -110,5 +110,16 @@ class TestToString(SleekTest):
self.failUnless(result == expected,
"Stanza Unicode handling is incorrect: %s" % result)
+ def testXMLLang(self):
+ """Test that serializing xml:lang works."""
+
+ 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)