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.
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user