本文整理匯總了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()))