本文整理汇总了Python中issues.models.Issue.all方法的典型用法代码示例。如果您正苦于以下问题:Python Issue.all方法的具体用法?Python Issue.all怎么用?Python Issue.all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类issues.models.Issue
的用法示例。
在下文中一共展示了Issue.all方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
# 需要导入模块: from issues.models import Issue [as 别名]
# 或者: from issues.models.Issue import all [as 别名]
def setUp(self):
for issue in Issue.all(): issue.delete()
for log in Log.all(): log.delete()
for comment in Comment.all(): comment.delete()
for group in Group.all(): group.delete()
for error in Error.all(): error.delete()
for project in Project.all(): project.delete()
示例2: testIssueNotification
# 需要导入模块: from issues.models import Issue [as 别名]
# 或者: from issues.models.Issue import all [as 别名]
def testIssueNotification(self):
user = create_user()
issue = Issue()
issue.description = "This is a test"
issue.save()
assert Issue.all().count() == 1
示例3: issue_by_number
# 需要导入模块: from issues.models import Issue [as 别名]
# 或者: from issues.models.Issue import all [as 别名]
def issue_by_number(pk):
""" Get's the issue by a primary key or a number, i like hacking the url so
you can just put in a number in the URL """
number = safe_int(pk)
if number:
issues = Issue.all().filter("number = ", number)
return issues[0]
else:
return Issue.get(pk)
示例4: testIssueAndErrorNotification
# 需要导入模块: from issues.models import Issue [as 别名]
# 或者: from issues.models.Issue import all [as 别名]
def testIssueAndErrorNotification(self):
user = create_user()
issue = Issue()
issue.description = "This is a test"
issue.save()
assert Issue.all().count() == 1
c = Client()
c.post(reverse("error-post"), test_data)
#assert Notification.all().count() == 2
# this would be 2 when issues are turned on
assert Notification.all().count() == 1
c = Client()
res = c.get(reverse("notification-send"))
self.assertEquals(len(mail.outbox), 1)
示例5: setUp
# 需要导入模块: from issues.models import Issue [as 别名]
# 或者: from issues.models.Issue import all [as 别名]
def setUp(self):
for error in Error.all(): error.delete()
for notification in Notification.all(): notification.delete()
for user in AppUser.all(): user.delete()
for issue in Issue.all(): issue.delete()