Add js-reverse as a dependency, also integrate it
This commit is contained in:
parent
6a20ba1935
commit
13c09bb856
10
api/tests.py
Normal file
10
api/tests.py
Normal file
@ -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)
|
@ -1,7 +1,8 @@
|
|||||||
from django.conf.urls import patterns, url
|
from django.conf.urls import patterns, url
|
||||||
|
from django.views.decorators.cache import cache_page
|
||||||
from . import views
|
from django_js_reverse.views import urls_js
|
||||||
|
|
||||||
urlpatterns = patterns(
|
urlpatterns = patterns(
|
||||||
'',
|
'',
|
||||||
|
url(r'^reverse.js$', cache_page(3600)(urls_js), name = 'js_reverse'),
|
||||||
)
|
)
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Rubber Duck Booking Tool</title>
|
<title>Rubber Duck Booking Tool</title>
|
||||||
|
|
||||||
|
<script src="{% url 'api:js_reverse' %}" type="text/javascript"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Rubber Duck Booking Tool</h1>
|
<h1>Rubber Duck Booking Tool</h1>
|
||||||
|
@ -36,6 +36,7 @@ INSTALLED_APPS = (
|
|||||||
'django.contrib.sessions',
|
'django.contrib.sessions',
|
||||||
'django.contrib.messages',
|
'django.contrib.messages',
|
||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
|
'django_js_reverse',
|
||||||
'accounts',
|
'accounts',
|
||||||
'booking',
|
'booking',
|
||||||
)
|
)
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
Django>=1.7,<1.8
|
Django>=1.7,<1.8
|
||||||
WebTest==2.0.17
|
WebTest==2.0.17
|
||||||
django-webtest==1.7.7
|
django-webtest==1.7.7
|
||||||
|
django-js-reverse==0.3.3
|
||||||
|
Loading…
Reference in New Issue
Block a user