当前位置: 首页>>代码示例>>Python>>正文


Python MLNGPlaceholderActions.copy方法代码示例

本文整理汇总了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)
开发者ID:124bit,项目名称:django_ukrhim,代码行数:17,代码来源:placeholder.py

示例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')
开发者ID:AdrianRibao,项目名称:django-cms,代码行数:17,代码来源:placeholder.py

示例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)
开发者ID:alainwolf,项目名称:openbroadcast.org,代码行数:17,代码来源:placeholder.py

示例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")
开发者ID:alainwolf,项目名称:openbroadcast.org,代码行数:18,代码来源:placeholder.py


注:本文中的cms.utils.placeholder.MLNGPlaceholderActions.copy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。