本文整理汇总了Python中hc.api.models.Channel.email方法的典型用法代码示例。如果您正苦于以下问题:Python Channel.email方法的具体用法?Python Channel.email怎么用?Python Channel.email使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hc.api.models.Channel
的用法示例。
在下文中一共展示了Channel.email方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_it_checks_check_user
# 需要导入模块: from hc.api.models import Channel [as 别名]
# 或者: from hc.api.models.Channel import email [as 别名]
def test_it_checks_check_user(self):
charlies_channel = Channel(user=self.charlie, kind="email")
charlies_channel.email = "[email protected]"
charlies_channel.save()
payload = {
"channel": charlies_channel.code,
"check-%s" % self.check.code: True
}
self.client.login(username="[email protected]", password="password")
r = self.client.post("/integrations/", data=payload)
# mc belongs to charlie but self.check does not--
assert r.status_code == 403
示例2: test_it_checks_check_user
# 需要导入模块: from hc.api.models import Channel [as 别名]
# 或者: from hc.api.models.Channel import email [as 别名]
def test_it_checks_check_user(self):
mallory = User(username="mallory", email="[email protected]")
mallory.set_password("password")
mallory.save()
mc = Channel(user=mallory, kind="email")
mc.email = "[email protected]"
mc.save()
payload = {
"channel": mc.code,
"check-%s" % self.check.code: True
}
self.client.login(username="[email protected]", password="password")
r = self.client.post("/integrations/", data=payload)
# mc belongs to mallorym but self.check does not--
assert r.status_code == 403