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


Python Harness.setUp方法代碼示例

本文整理匯總了Python中liberapay.testing.Harness.setUp方法的典型用法代碼示例。如果您正苦於以下問題:Python Harness.setUp方法的具體用法?Python Harness.setUp怎麽用?Python Harness.setUp使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在liberapay.testing.Harness的用法示例。


在下文中一共展示了Harness.setUp方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: setUp

# 需要導入模塊: from liberapay.testing import Harness [as 別名]
# 或者: from liberapay.testing.Harness import setUp [as 別名]
    def setUp(self):
        Harness.setUp(self)

        # Alice joins a community.
        self.alice = self.make_participant('alice', balance=100)
        self.client.POST('/alice/communities.json', {'do': 'join:something'},
                         auth_as=self.alice, xhr=True)
開發者ID:kthurimella,項目名稱:liberapay.com,代碼行數:9,代碼來源:test_communities.py

示例2: setUp

# 需要導入模塊: from liberapay.testing import Harness [as 別名]
# 或者: from liberapay.testing.Harness import setUp [as 別名]
    def setUp(self):
        Harness.setUp(self)

        # Alice joins a community.
        self.alice = self.make_participant('alice', balance=100)
        c = self.alice.create_community('C++')
        self.alice.upsert_community_membership(True, c.id)
開發者ID:devmiyax,項目名稱:liberapay.com,代碼行數:9,代碼來源:test_communities.py

示例3: setUp

# 需要導入模塊: from liberapay.testing import Harness [as 別名]
# 或者: from liberapay.testing.Harness import setUp [as 別名]
    def setUp(self):
        Harness.setUp(self)

        # Alice joins a community.
        self.alice = self.make_participant('alice', balance=100)
        self.client.POST('/alice/communities.json', {'do': 'join:something'},
                         auth_as=self.alice, HTTP_X_REQUESTED_WITH=b'XMLHttpRequest')
開發者ID:Changaco,項目名稱:liberapay.com,代碼行數:9,代碼來源:test_communities.py

示例4: setUp

# 需要導入模塊: from liberapay.testing import Harness [as 別名]
# 或者: from liberapay.testing.Harness import setUp [as 別名]
    def setUp(self):
        Harness.setUp(self)

        # Alice joins a community.
        self.alice = self.make_participant('alice', balance=100)
        c = self.alice.create_community('something')
        self.alice.update_community_status('memberships', True, c.id)
開發者ID:Calinou,項目名稱:liberapay.com,代碼行數:9,代碼來源:test_communities.py

示例5: setUp

# 需要導入模塊: from liberapay.testing import Harness [as 別名]
# 或者: from liberapay.testing.Harness import setUp [as 別名]
 def setUp(self):
     Harness.setUp(self)
     self.david = self.make_participant(
         "david",
         is_suspicious=False,
         mangopay_user_id=self.david_id,
         mangopay_wallet_id=self.david_wallet_id,
         email="[email protected]",
     )
     self.janet = self.make_participant(
         "janet",
         is_suspicious=False,
         mangopay_user_id=self.janet_id,
         mangopay_wallet_id=self.janet_wallet_id,
         email="[email protected]",
     )
     self.janet_route = ExchangeRoute.insert(self.janet, "mango-cc", self.card_id)
     self.homer = self.make_participant(
         "homer",
         is_suspicious=False,
         mangopay_user_id=self.homer_id,
         mangopay_wallet_id=self.homer_wallet_id,
         email="[email protected]",
     )
     self.homer_route = ExchangeRoute.insert(self.homer, "mango-ba", self.bank_account.Id)
開發者ID:kthurimella,項目名稱:liberapay.com,代碼行數:27,代碼來源:mangopay.py

示例6: setUp

# 需要導入模塊: from liberapay.testing import Harness [as 別名]
# 或者: from liberapay.testing.Harness import setUp [as 別名]
 def setUp(self):
     Harness.setUp(self)
     self.mailer_patcher = mock.patch.object(Participant._mailer.messages, 'send')
     self.mailer = self.mailer_patcher.start()
     self.addCleanup(self.mailer_patcher.stop)
     sleep_patcher = mock.patch('liberapay.models.participant.sleep')
     sleep_patcher.start()
     self.addCleanup(sleep_patcher.stop)
開發者ID:Changaco,項目名稱:liberapay.com,代碼行數:10,代碼來源:emails.py

示例7: setUp

# 需要導入模塊: from liberapay.testing import Harness [as 別名]
# 或者: from liberapay.testing.Harness import setUp [as 別名]
    def setUp(self):
        Harness.setUp(self)

        # Grab configuration from the environment, storing for later.
        env = wireup.env()
        self.environ = env.environ

        # Change env, doesn't change self.environ.
        env.canonical_scheme = 'https'
        env.canonical_host = 'example.com'

        wireup.canonical(env)
開發者ID:kthurimella,項目名稱:liberapay.com,代碼行數:14,代碼來源:test_hooks.py

示例8: setUp

# 需要導入模塊: from liberapay.testing import Harness [as 別名]
# 或者: from liberapay.testing.Harness import setUp [as 別名]
 def setUp(self):
     Harness.setUp(self)
     self.david = self.make_participant(
         'david', mangopay_user_id=self.david_id,
         mangopay_wallet_id=self.david_wallet_id, email='[email protected]'
     )
     self.janet = self.make_participant(
         'janet', mangopay_user_id=self.janet_id,
         mangopay_wallet_id=self.janet_wallet_id, email='[email protected]'
     )
     self.janet_route = ExchangeRoute.insert(self.janet, 'mango-cc', self.card_id)
     self.homer = self.make_participant(
         'homer', mangopay_user_id=self.homer_id,
         mangopay_wallet_id=self.homer_wallet_id, email='[email protected]'
     )
     self.homer_route = ExchangeRoute.insert(self.homer, 'mango-ba', self.bank_account.Id)
開發者ID:Calinou,項目名稱:liberapay.com,代碼行數:18,代碼來源:mangopay.py

示例9: setUp

# 需要導入模塊: from liberapay.testing import Harness [as 別名]
# 或者: from liberapay.testing.Harness import setUp [as 別名]
 def setUp(self):
     Harness.setUp(self)
     self.team = self.make_participant('A-Team', kind='group')
開發者ID:Calinou,項目名稱:liberapay.com,代碼行數:5,代碼來源:test_teams.py

示例10: setUp

# 需要導入模塊: from liberapay.testing import Harness [as 別名]
# 或者: from liberapay.testing.Harness import setUp [as 別名]
 def setUp(self):
     Harness.setUp(self)
     self.alice = self.make_participant('alice')
     self.bob = self.make_participant('bob')
開發者ID:liberapay,項目名稱:liberapay.com,代碼行數:6,代碼來源:test_newsletters.py

示例11: setUp

# 需要導入模塊: from liberapay.testing import Harness [as 別名]
# 或者: from liberapay.testing.Harness import setUp [as 別名]
 def setUp(self):
     Harness.setUp(self)
     self.team = self.make_participant("team", kind='group')
     self.alice = self.make_participant("alice")
開發者ID:Changaco,項目名稱:liberapay.com,代碼行數:6,代碼來源:test_membername_json.py

示例12: setUp

# 需要導入模塊: from liberapay.testing import Harness [as 別名]
# 或者: from liberapay.testing.Harness import setUp [as 別名]
 def setUp(self):
     Harness.setUp(self)
     self.a_team = self.make_participant('A-Team', kind='group')
     self.alice = self.make_participant('alice')
     self.a_team.add_member(self.alice)
     self.bob = self.make_participant('bob', email='[email protected]')
開發者ID:astiob,項目名稱:liberapay.com,代碼行數:8,代碼來源:test_teams.py

示例13: setUp

# 需要導入模塊: from liberapay.testing import Harness [as 別名]
# 或者: from liberapay.testing.Harness import setUp [as 別名]
 def setUp(self):
     Harness.setUp(self)
     for username in ['alice', 'bob', 'carl']:
         p = self.make_participant(username, elsewhere='twitter')
         setattr(self, username, p)
開發者ID:kthurimella,項目名稱:liberapay.com,代碼行數:7,代碼來源:test_participant.py

示例14: setUp

# 需要導入模塊: from liberapay.testing import Harness [as 別名]
# 或者: from liberapay.testing.Harness import setUp [as 別名]
 def setUp(self):
     Harness.setUp(self)
     self.alice_elsewhere = self.make_elsewhere('twitter', -1, 'alice')
     token, expires = self.alice_elsewhere.make_connect_token()
     self.connect_cookie = {'connect_%s' % self.alice_elsewhere.id: token}
     self.bob = self.make_participant('bob')
開發者ID:devmiyax,項目名稱:liberapay.com,代碼行數:8,代碼來源:test_elsewhere.py

示例15: setUp

# 需要導入模塊: from liberapay.testing import Harness [as 別名]
# 或者: from liberapay.testing.Harness import setUp [as 別名]
 def setUp(self):
     Harness.setUp(self)
     self.bar = self.make_participant('bar', is_admin=True)
開發者ID:kthurimella,項目名稱:liberapay.com,代碼行數:5,代碼來源:test_is_suspicious.py


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