本文整理汇总了Python中applications.zcomx.modules.creators.Creator.name_for_url方法的典型用法代码示例。如果您正苦于以下问题:Python Creator.name_for_url方法的具体用法?Python Creator.name_for_url怎么用?Python Creator.name_for_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类applications.zcomx.modules.creators.Creator
的用法示例。
在下文中一共展示了Creator.name_for_url方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test__url
# 需要导入模块: from applications.zcomx.modules.creators import Creator [as 别名]
# 或者: from applications.zcomx.modules.creators.Creator import name_for_url [as 别名]
def test__url(self):
creator = Creator(dict(email='[email protected]'))
tests = [
# (name_for_url, expect)
(None, None),
('Prince', '/Prince'),
('FirstLast', '/FirstLast'),
('firstlast', '/firstlast'),
("HélèDEñça", '/H%C3%A9l%C3%A8DE%C3%B1%C3%A7a'),
]
for t in tests:
creator.name_for_url = t[0]
self.assertEqual(url(creator), t[1])