本文整理汇总了Python中snippets.base.tests.ClientMatchRuleFactory.create_batch方法的典型用法代码示例。如果您正苦于以下问题:Python ClientMatchRuleFactory.create_batch方法的具体用法?Python ClientMatchRuleFactory.create_batch怎么用?Python ClientMatchRuleFactory.create_batch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类snippets.base.tests.ClientMatchRuleFactory
的用法示例。
在下文中一共展示了ClientMatchRuleFactory.create_batch方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _dup_test
# 需要导入模块: from snippets.base.tests import ClientMatchRuleFactory [as 别名]
# 或者: from snippets.base.tests.ClientMatchRuleFactory import create_batch [as 别名]
def _dup_test(self, snippet):
snippet.client_match_rules.add(*ClientMatchRuleFactory.create_batch(3))
snippet_copy = snippet.duplicate()
eq_(snippet_copy.disabled, True)
ok_(snippet_copy.id != snippet.id)
eq_(snippet_copy.locale_set.count(), 1)
ok_(snippet_copy.locale_set.all()[0] != snippet.locale_set.all()[0])
eq_(set(snippet_copy.client_match_rules.all()), set(snippet.client_match_rules.all()))
示例2: _dup_test
# 需要导入模块: from snippets.base.tests import ClientMatchRuleFactory [as 别名]
# 或者: from snippets.base.tests.ClientMatchRuleFactory import create_batch [as 别名]
def _dup_test(self, snippet):
snippet.client_match_rules.add(*ClientMatchRuleFactory.create_batch(3))
snippet_copy = snippet.duplicate()
self.assertEqual(snippet_copy.disabled, True)
self.assertTrue(snippet_copy.id != snippet.id)
self.assertEqual(snippet_copy.locales.count(), 1)
self.assertTrue(snippet_copy.locales.all()[0] == snippet.locales.all()[0])
self.assertEqual(set(snippet_copy.client_match_rules.all()),
set(snippet.client_match_rules.all()))