"Add Check" was broken, fixing.

This commit is contained in:
Pēteris Caune 2015-07-10 12:54:18 +03:00
parent 8628be8584
commit b2dc319e6c
3 changed files with 21 additions and 2 deletions

View File

@ -0,0 +1,19 @@
from django.contrib.auth.models import User
from django.test import TestCase
from hc.api.models import Check
class AddCheckTestCase(TestCase):
def setUp(self):
self.alice = User(username="alice")
self.alice.set_password("password")
self.alice.save()
def test_it_works(self):
url = "/checks/add/"
self.client.login(username="alice", password="password")
r = self.client.post(url)
assert r.status_code == 302
assert Check.objects.count() == 1

View File

@ -73,7 +73,7 @@ def add_check(request):
check = Check(user=request.user)
check.save()
return redirect("hc-checks")
return redirect("hc-index")
@login_required

View File

@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>{% block title %}healthchecks.io - Get Notified When Your Cron Jobs Fail{% endblock %}</title>
<meta name="description" content="Get Notified When Your Cron Jobs Fail. Free alternative to Cronitor and Dead Man's Snitch.">
<meta name="description" content="Monitor and Get Notified When Your Cron Jobs Fail. Free alternative to Cronitor and Dead Man's Snitch.">
<meta name="keywords" content="monitor cron jobs daemon background worker service cronjob monitoring crontab alert notify cronitor deadmanssnitch">
{% load staticfiles %}