Add test for django polymorphic regression

Django 1.11 introduced a django polymorphic regression, add a test
to prevent this creeping back in
This commit is contained in:
Frank Hamand 2017-04-16 21:32:18 +01:00
parent 5a4f871eaa
commit c2e1607de4

View File

@ -8,7 +8,7 @@ from datetime import timedelta, date
import os
import requests
from cabot.cabotapp.graphite import parse_metric
from cabot.cabotapp.alert import update_alert_plugins
from cabot.cabotapp.alert import update_alert_plugins, AlertPlugin
from cabot.cabotapp.models import (
GraphiteStatusCheck, JenkinsStatusCheck,
HttpStatusCheck, ICMPStatusCheck, Service, Instance,
@ -197,6 +197,13 @@ def throws_timeout(*args, **kwargs):
raise requests.RequestException(u'фиктивная ошибка innit')
class TestPolymorphic(LocalTestCase):
def test_polymorphic(self):
plugin = AlertPlugin.objects.first()
self.assertIn(type(plugin), AlertPlugin.__subclasses__())
class TestCheckRun(LocalTestCase):
def test_calculate_service_status(self):