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()
def testIssueNotification(self): user = create_user() issue = Issue() issue.description = "This is a test" issue.save() assert Issue.all().count() == 1
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)
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()
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)