Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 1f7b413349
Fetching contributors…

Cannot retrieve contributors at this time

41 lines (30 sloc) 1.207 kb
# -*- coding: utf-8 -*-
from unittest import main
import sys
from six import u
from base import Base
class TestAttributes(Base):
def test_raw_attribute_names(self):
self.assertHTML(
'%({"b-dash": "two"}, a="one", **{"c-dash": "three"}) content',
'<div a="one" b-dash="two" c-dash="three">content</div>\n'
)
def test_camelcase_attributes(self):
self.assertHTML(
'%({"positionalDict":"xxx"}, keywordArgument="xxx", **{"expandedDict":"xxx"}) content',
'<div expanded-dict="xxx" keyword-argument="xxx" positional-dict="xxx">content</div>\n'
)
def test_camelcase_override(self):
self.assertHTML(
'%({"positionalDict":"xxx"}, keywordArgument="xxx", __adapt_camelcase=False, **{"expandedDict":"xxx"}) content',
'<div expandedDict="xxx" keywordArgument="xxx" positionalDict="xxx">content</div>\n'
)
def test_unicode_arguments(self):
if sys.version_info > (3,):
return
self.assertHTML(
u('%(a=u"España") content'),
u('<div a="España">content</div>\n')
)
if __name__ == "__main__":
main()
Jump to Line
Something went wrong with that request. Please try again.