Fixes #455pull/456/head
@ -0,0 +1,23 @@ | |||||
# Generated by Django 3.1.2 on 2020-11-28 09:51 | |||||
from django.db import migrations, models | |||||
class Migration(migrations.Migration): | |||||
dependencies = [ | |||||
('api', '0075_auto_20200805_1004'), | |||||
] | |||||
operations = [ | |||||
migrations.AddField( | |||||
model_name='ping', | |||||
name='exitstatus', | |||||
field=models.SmallIntegerField(null=True), | |||||
), | |||||
migrations.AlterField( | |||||
model_name='channel', | |||||
name='kind', | |||||
field=models.CharField(choices=[('email', 'Email'), ('webhook', 'Webhook'), ('hipchat', 'HipChat'), ('slack', 'Slack'), ('pd', 'PagerDuty'), ('pagertree', 'PagerTree'), ('pagerteam', 'Pager Team'), ('po', 'Pushover'), ('pushbullet', 'Pushbullet'), ('opsgenie', 'OpsGenie'), ('victorops', 'VictorOps'), ('discord', 'Discord'), ('telegram', 'Telegram'), ('sms', 'SMS'), ('zendesk', 'Zendesk'), ('trello', 'Trello'), ('matrix', 'Matrix'), ('whatsapp', 'WhatsApp'), ('apprise', 'Apprise'), ('mattermost', 'Mattermost'), ('msteams', 'Microsoft Teams'), ('shell', 'Shell Command'), ('zulip', 'Zulip'), ('spike', 'Spike'), ('call', 'Phone Call'), ('linenotify', 'LINE Notify')], max_length=20), | |||||
), | |||||
] |
@ -59,3 +59,17 @@ class PingDetailsTestCase(BaseTestCase): | |||||
self.client.login(username="[email protected]", password="password") | self.client.login(username="[email protected]", password="password") | ||||
r = self.client.get("/checks/%s/pings/123/" % self.check.code) | r = self.client.get("/checks/%s/pings/123/" % self.check.code) | ||||
self.assertContains(r, "No additional information is", status_code=200) | self.assertContains(r, "No additional information is", status_code=200) | ||||
def test_it_shows_nonzero_exitstatus(self): | |||||
Ping.objects.create(owner=self.check, kind="fail", exitstatus=42) | |||||
self.client.login(username="[email protected]", password="password") | |||||
r = self.client.get(self.url) | |||||
self.assertContains(r, "(failure, exit status 42)", status_code=200) | |||||
def test_it_shows_zero_exitstatus(self): | |||||
Ping.objects.create(owner=self.check, exitstatus=0) | |||||
self.client.login(username="[email protected]", password="password") | |||||
r = self.client.get(self.url) | |||||
self.assertContains(r, "(exit status 0)", status_code=200) |