diff --git a/tests/test_views.py b/tests/test_views.py index 41f34cb..2e1505b 100644 --- a/tests/test_views.py +++ b/tests/test_views.py @@ -118,3 +118,10 @@ def test_response_404_when_none_specified(self): def tearDown(self): pass + + +class TestWatchmanDashboard(unittest.TestCase): + def test_dashboard_response_code(self): + request = RequestFactory().get('/') + response = views.dashboard(request) + self.assertEqual(response.status_code, 200) diff --git a/watchman/templates/watchman/dashboard.html b/watchman/templates/watchman/dashboard.html index 6f00e44..b71b9b9 100644 --- a/watchman/templates/watchman/dashboard.html +++ b/watchman/templates/watchman/dashboard.html @@ -12,12 +12,12 @@ {% block content %}

{% trans 'System Status' %}

-

- {% if overall_status == 'OK' %} +

+ {% if overall_status %} {% trans 'All systems up and running!' %} {% else %} {% trans 'WARNING - Some systems down!' %} - {% endif %} + {% endif %}{# overall_status #}

@@ -32,18 +32,18 @@

+ {{ type.type|title }} {{ thing.name|title }} - {% if thing.status == 'OK' %} + {% if thing.ok %} {% trans 'OK' %} {% else %} - + - {% endif %}{# thing.status == 'OK' #} + {% endif %}{# thing.ok #} {% endfor %}{# for thing in type.statuses #} @@ -55,20 +55,20 @@

{% trans 'Click an error button to see the full traceback' %}{% endif %}{# overall_status != 'OK' #} + {% if not overall_status %}{% trans 'Click an error button to see the full traceback' %}{% endif %}{# overall_status #}

{% endblock %}{# status_content #} {% for type in checks %} {% for thing in type.statuses %} - {% if thing.status != 'OK' %} -