forked from GithubBackups/healthchecks
"Add Check" was broken, fixing.
This commit is contained in:
parent
8628be8584
commit
b2dc319e6c
19
hc/front/tests/test_add_check.py
Normal file
19
hc/front/tests/test_add_check.py
Normal 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
|
@ -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
|
||||
|
@ -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…
x
Reference in New Issue
Block a user