本文整理汇总了Python中cms.utils.placeholder.MLNGPlaceholderActions.get_copy_languages方法的典型用法代码示例。如果您正苦于以下问题:Python MLNGPlaceholderActions.get_copy_languages方法的具体用法?Python MLNGPlaceholderActions.get_copy_languages怎么用?Python MLNGPlaceholderActions.get_copy_languages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cms.utils.placeholder.MLNGPlaceholderActions
的用法示例。
在下文中一共展示了MLNGPlaceholderActions.get_copy_languages方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_mlng_placeholder_actions_get_copy_languages
# 需要导入模块: from cms.utils.placeholder import MLNGPlaceholderActions [as 别名]
# 或者: from cms.utils.placeholder.MLNGPlaceholderActions import get_copy_languages [as 别名]
def test_mlng_placeholder_actions_get_copy_languages(self):
actions = MLNGPlaceholderActions()
fr = Translations.objects.get(language_code="fr")
de = Translations.objects.get(language_code="de")
en = Translations.objects.get(language_code="en")
fieldname = "placeholder"
fr_copy_languages = actions.get_copy_languages(fr.placeholder, Translations, fieldname)
de_copy_languages = actions.get_copy_languages(de.placeholder, Translations, fieldname)
en_copy_languages = actions.get_copy_languages(en.placeholder, Translations, fieldname)
EN = ("en", "English")
FR = ("fr", "French")
self.assertEqual(fr_copy_languages, [EN])
self.assertEqual(de_copy_languages, [EN, FR])
self.assertEqual(en_copy_languages, [FR])
示例2: test_mlng_placeholder_actions_get_copy_languages
# 需要导入模块: from cms.utils.placeholder import MLNGPlaceholderActions [as 别名]
# 或者: from cms.utils.placeholder.MLNGPlaceholderActions import get_copy_languages [as 别名]
def test_mlng_placeholder_actions_get_copy_languages(self):
actions = MLNGPlaceholderActions()
fr = Translations.objects.get(language_code='fr')
de = Translations.objects.get(language_code='de')
en = Translations.objects.get(language_code='en')
fieldname = 'placeholder'
fr_copy_languages = actions.get_copy_languages(
fr.placeholder, Translations, fieldname
)
de_copy_languages = actions.get_copy_languages(
de.placeholder, Translations, fieldname
)
en_copy_languages = actions.get_copy_languages(
en.placeholder, Translations, fieldname
)
EN = ('en', 'English')
FR = ('fr', 'French')
self.assertEqual(fr_copy_languages, [EN])
self.assertEqual(de_copy_languages, [EN, FR])
self.assertEqual(en_copy_languages, [FR])