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