本文整理汇总了Python中test_factory.Factory.group方法的典型用法代码示例。如果您正苦于以下问题:Python Factory.group方法的具体用法?Python Factory.group怎么用?Python Factory.group使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类test_factory.Factory
的用法示例。
在下文中一共展示了Factory.group方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_challenge_has_added_board
# 需要导入模块: from test_factory import Factory [as 别名]
# 或者: from test_factory.Factory import group [as 别名]
def test_challenge_has_added_board(self):
Factory.tag(self.a1, name="Board of Directors")
bg = Factory.group(self.a1,"board of directors")
Factory.grouprule(self.a1, "have any tag that","contains","Board of Directors", group=bg)
Factory.tag_person(self.a1, tag_name="Board of Directors")
self.a1.check_challenge_progress()
assert self.a1.challenge_has_added_board == True
示例2: test_that_requesting_an_invalid_group_404s
# 需要导入模块: from test_factory import Factory [as 别名]
# 或者: from test_factory.Factory import group [as 别名]
def test_that_requesting_an_invalid_group_404s(self):
sel = self.selenium
self.go_to_the_login_page()
self.log_in()
self.assert_login_succeeded()
# make sure to make a new person
for i in range(0,10):
Factory.group(account=self.a1)
self.create_new_group()
# get pk
url = sel.get_location()
url = url[url.find(":%s/" % settings.LIVE_SERVER_PORT)+5:]
a2 = self.create_demo_site("test2")
ua = Factory.useraccount(account=a2)
self.go_to_the_login_page(site="test2")
self.log_in(ua=ua)
self.open(url, site="test2")
time.sleep(10)
assert sel.is_text_present("not found")
示例3: test_invalid_rule_missing_operator_side
# 需要导入模块: from test_factory import Factory [as 别名]
# 或者: from test_factory.Factory import group [as 别名]
def test_invalid_rule_missing_operator_side(self):
right_hand_term="test"
# operator_name="contains"
group = Factory.group(self.account)
left_side = LeftSide.objects_by_account(self.account).get(display_name="have a General tag that")
# icontains = Operator.objects_by_account(self.account).get(display_name=operator_name)
icontains = None
rst = self._text_right_side_types[0]
rsv = right_hand_term
GroupRule.raw_objects.create(account=self.account, group=group, left_side=left_side, operator=icontains, right_side_value=rsv, right_side_type=rst)
self.assertEqual(group.has_a_valid_rule, False)
示例4: test_create_new_group_rule_for_general_tag_contains
# 需要导入模块: from test_factory import Factory [as 别名]
# 或者: from test_factory.Factory import group [as 别名]
def test_create_new_group_rule_for_general_tag_contains(self, right_hand_term="test", operator_name="contains"):
# create a new group rule
group = Factory.group(self.account)
left_side = LeftSide.objects_by_account(self.account).get(display_name="have a General tag that")
icontains = Operator.objects_by_account(self.account).get(display_name=operator_name)
rst = self._text_right_side_types[0]
rsv = right_hand_term
group_rule = GroupRule.raw_objects.create(account=self.account, group=group, left_side=left_side, operator=icontains, right_side_value=rsv, right_side_type=rst)
new_group_rule = GroupRule.objects_by_account(self.account).get(pk=group_rule.pk)
# assert the correct models exist
self.assertEqual(new_group_rule.group, group)
self.assertEqual(new_group_rule.left_side, left_side)
self.assertEqual(new_group_rule.operator, icontains)
self.assertEqual(new_group_rule.right_side_value, rsv)
self.assertEqual(new_group_rule.group, group)
return group, new_group_rule
示例5: test_create_new_group_rule_for_volunteer_status_is_inactive
# 需要导入模块: from test_factory import Factory [as 别名]
# 或者: from test_factory.Factory import group [as 别名]
def test_create_new_group_rule_for_volunteer_status_is_inactive(self, right_hand_term="inactive", operator_name="is"):
# create a new group
group = Factory.group(self.account)
# create a new group rule
left_side = LeftSide.objects_by_account(self.account).get(display_name="volunteer status")
icontains = Operator.objects_by_account(self.account).get(display_name=operator_name)
rst = self._choices_right_side_types[0]
rsv = right_hand_term
group_rule = GroupRule.raw_objects.create(account=self.account, group=group, left_side=left_side, operator=icontains, right_side_value=rsv, right_side_type=rst)
new_group_rule = GroupRule.objects_by_account(self.account).get(pk=group_rule.pk)
# assert the correct models exist
self.assertEqual(new_group_rule.group, group)
self.assertEqual(new_group_rule.left_side, left_side)
self.assertEqual(new_group_rule.operator, icontains)
self.assertEqual(new_group_rule.right_side_value, rsv)
self.assertEqual(new_group_rule.group, group)
return group, new_group_rule
示例6: test_create_new_group_rule_for_last_donation_is_after
# 需要导入模块: from test_factory import Factory [as 别名]
# 或者: from test_factory.Factory import group [as 别名]
def test_create_new_group_rule_for_last_donation_is_after(self, right_hand_term="2/12/2009", operator_name="is after"):
# create a new group
group = Factory.group(self.account)
# create a new group rule
left_side = LeftSide.objects_by_account(self.account).get(display_name="last donation")
op = Operator.objects_by_account(self.account).get(display_name=operator_name)
rst = self._date_right_side_types[0]
rsv = right_hand_term
group_rule = GroupRule.raw_objects.create(account=self.account, group=group, left_side=left_side, operator=op, right_side_value=rsv, right_side_type=rst)
new_group_rule = GroupRule.objects_by_account(self.account).get(pk=group_rule.pk)
# assert the correct models exist
self.assertEqual(new_group_rule.group, group)
self.assertEqual(new_group_rule.left_side, left_side)
self.assertEqual(new_group_rule.operator, op)
self.assertEqual(new_group_rule.right_side_value, rsv)
self.assertEqual(new_group_rule.group, group)
return group, new_group_rule
示例7: test_create_new_group_rule_for_custom_tag_is_exactly
# 需要导入模块: from test_factory import Factory [as 别名]
# 或者: from test_factory.Factory import group [as 别名]
def test_create_new_group_rule_for_custom_tag_is_exactly(self, right_hand_term="test", operator_name="is exactly"):
# create a new group
group = Factory.group(self.account)
# make the custom tag
TagSet.raw_objects.get_or_create(account=self.account, name="new test tagset")
populate_rule_components_for_an_account(self.account)
# create a new group rule
left_side = LeftSide.objects_by_account(self.account).get(display_name="have a new test tagset tag that")
icontains = Operator.objects_by_account(self.account).get(display_name=operator_name)
rst = self._text_right_side_types[0]
rsv = right_hand_term
group_rule = GroupRule.raw_objects.create(account=self.account, group=group, left_side=left_side, operator=icontains, right_side_value=rsv, right_side_type=rst)
new_group_rule = GroupRule.objects_by_account(self.account).get(pk=group_rule.pk)
# assert the correct models exist
self.assertEqual(new_group_rule.group, group)
self.assertEqual(new_group_rule.left_side, left_side)
self.assertEqual(new_group_rule.operator, icontains)
self.assertEqual(new_group_rule.right_side_value, rsv)
self.assertEqual(new_group_rule.group, group)
return group, new_group_rule