Browse Source

"Add Check" was broken, fixing.

pull/7/head
Pēteris Caune 9 years ago
parent
commit
b2dc319e6c
3 changed files with 21 additions and 2 deletions
  1. +19
    -0
      hc/front/tests/test_add_check.py
  2. +1
    -1
      hc/front/views.py
  3. +1
    -1
      templates/base.html

+ 19
- 0
hc/front/tests/test_add_check.py 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

+ 1
- 1
hc/front/views.py 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


+ 1
- 1
templates/base.html 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 %}


Loading…
Cancel
Save