diff --git a/tuskar_ui/infrastructure/resource_management/urls.py b/tuskar_ui/infrastructure/resource_management/urls.py index 03d2ce87e..17ce65e0d 100644 --- a/tuskar_ui/infrastructure/resource_management/urls.py +++ b/tuskar_ui/infrastructure/resource_management/urls.py @@ -12,6 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. +from django import conf from django.conf.urls import defaults from tuskar_ui.infrastructure.resource_management.nodes\ @@ -21,6 +22,8 @@ from tuskar_ui.infrastructure.resource_management.racks\ from tuskar_ui.infrastructure.resource_management.resource_classes\ import urls as resource_classes_urls from tuskar_ui.infrastructure.resource_management import views +from tuskar_ui.test import urls as test_urls + urlpatterns = defaults.patterns('', defaults.url(r'^$', views.IndexView.as_view(), name='index'), @@ -34,3 +37,8 @@ urlpatterns = defaults.patterns('', namespace='resource_classes')), defaults.url(r'^nodes/', defaults.include(node_urls, namespace='nodes')), ) + +if conf.settings.DEBUG: + urlpatterns += defaults.patterns('', + defaults.url(r'^qunit$', defaults.include(test_urls, namespace='tests')) + ) diff --git a/tuskar_ui/infrastructure/templates/infrastructure/qunit.html b/tuskar_ui/infrastructure/templates/infrastructure/qunit.html new file mode 100644 index 000000000..ad03ae993 --- /dev/null +++ b/tuskar_ui/infrastructure/templates/infrastructure/qunit.html @@ -0,0 +1,27 @@ + + + + + Tuskar QUnit Test Suite + + + + {% include "horizon/_conf.html" %} + + {% comment %}Load test modules here.{% endcomment %} + {% comment %}End test modules.{% endcomment %} + + {% include "horizon/_scripts.html" %} + {% include "infrastructure/_scripts.html" %} + + +

Tuskar JavaScript Tests

+

+
+

+
    +
    + +
    + + diff --git a/tuskar_ui/test/urls.py b/tuskar_ui/test/urls.py new file mode 100644 index 000000000..a68c63f03 --- /dev/null +++ b/tuskar_ui/test/urls.py @@ -0,0 +1,21 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from django.conf.urls import defaults +from django.views import generic + + +urlpatterns = defaults.patterns('', defaults.url(r'^$', + generic.TemplateView.as_view(template_name="infrastructure/qunit.html"), + name='qunit_tests'))