當前位置: 首頁>>代碼示例>>Python>>正文


Python Factory.group方法代碼示例

本文整理匯總了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
開發者ID:skoczen,項目名稱:mycelium,代碼行數:9,代碼來源:unit_tests.py

示例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")
開發者ID:skoczen,項目名稱:mycelium,代碼行數:22,代碼來源:selenium_tests.py

示例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)
開發者ID:skoczen,項目名稱:mycelium,代碼行數:14,代碼來源:unit_tests.py

示例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
開發者ID:skoczen,項目名稱:mycelium,代碼行數:20,代碼來源:unit_tests.py

示例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
開發者ID:skoczen,項目名稱:mycelium,代碼行數:22,代碼來源:unit_tests.py

示例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
開發者ID:skoczen,項目名稱:mycelium,代碼行數:22,代碼來源:unit_tests.py

示例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
開發者ID:skoczen,項目名稱:mycelium,代碼行數:25,代碼來源:unit_tests.py


注:本文中的test_factory.Factory.group方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。