diff --git a/manage.py b/manage.py index 3522b988..69deb604 100755 --- a/manage.py +++ b/manage.py @@ -19,5 +19,5 @@ from django.core.management import execute_from_command_line if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", - "openstack_dashboard.settings") + "monitoring.test.settings") execute_from_command_line(sys.argv) diff --git a/monitoring/overview/tests.py b/monitoring/overview/tests.py index c127d4d2..395a8f6b 100644 --- a/monitoring/overview/tests.py +++ b/monitoring/overview/tests.py @@ -13,6 +13,7 @@ # under the License. from django.test import RequestFactory +from django.test.utils import override_settings from django.urls import reverse from monitoring.overview import constants @@ -26,6 +27,12 @@ INDEX_URL = reverse( class OverviewTest(helpers.TestCase): + @override_settings(DASHBOARDS=[], + KIBANA_POLICY_SCOPE='monitoring', + KIBANA_POLICY_RULE='monitoring:kibana_access', + ENABLE_LOG_MANAGEMENT_BUTTON=False, + ENABLE_EVENT_MANAGEMENT_BUTTON=False, + SHOW_GRAFANA_HOME=True) def test_index_get(self): res = self.client.get(INDEX_URL) self.assertTemplateUsed( diff --git a/monitoring/overview/views.py b/monitoring/overview/views.py index 9eec7269..3675a738 100644 --- a/monitoring/overview/views.py +++ b/monitoring/overview/views.py @@ -17,6 +17,7 @@ import copy import json import logging +from django.conf import settings from django.contrib import messages from django import http from django.http import HttpResponse @@ -25,16 +26,14 @@ from django.utils.translation import ugettext_lazy as _ # noqa from django.views.decorators.csrf import csrf_exempt from django.views import generic from django.views.generic import TemplateView +from horizon import exceptions from openstack_auth import utils as auth_utils from openstack_dashboard import policy import six from six.moves import urllib -from horizon import exceptions - from monitoring.alarms import tables as alarm_tables from monitoring import api -from monitoring.config import local_settings as settings from monitoring.overview import constants LOG = logging.getLogger(__name__)