diff --git a/api/tests.py b/api/tests.py new file mode 100644 index 0000000..66d1f29 --- /dev/null +++ b/api/tests.py @@ -0,0 +1,10 @@ +from django.test import TestCase, Client +from django.core.urlresolvers import reverse + +class ReverseTest(TestCase): + def setUp(self): + self.client = Client() + + def test_reverse_js(self): + response = self.client.get(reverse('api:js_reverse')) + self.assertEqual(response.status_code, 200) diff --git a/api/urls.py b/api/urls.py index 82981ec..b6b6367 100644 --- a/api/urls.py +++ b/api/urls.py @@ -1,7 +1,8 @@ from django.conf.urls import patterns, url - -from . import views +from django.views.decorators.cache import cache_page +from django_js_reverse.views import urls_js urlpatterns = patterns( '', + url(r'^reverse.js$', cache_page(3600)(urls_js), name = 'js_reverse'), ) diff --git a/booking/templates/front_template.html b/booking/templates/front_template.html index 8617def..31022c6 100644 --- a/booking/templates/front_template.html +++ b/booking/templates/front_template.html @@ -2,6 +2,8 @@