Move API under /api/v1/

This commit is contained in:
Gergely Polonkai 2015-05-28 00:32:41 +02:00
parent 2ba17dd61e
commit 720f9c9472
2 changed files with 4 additions and 4 deletions

View File

@ -41,7 +41,7 @@ class ApiTest(TestCase):
duckcomp.save() duckcomp.save()
def test_duck_comp_list(self): def test_duck_comp_list(self):
response = self.client.get('/api/duck/1/competence.json') response = self.client.get('/api/v1/duck/1/competence.json')
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
self.assertEqual(len(response.context['comp_list']), 1) self.assertEqual(len(response.context['comp_list']), 1)
@ -107,7 +107,7 @@ class DuckBookingTest(TestCase):
def send_booking_json(self, json_data): def send_booking_json(self, json_data):
return self.client.post( return self.client.post(
'/api/duck/book/', '/api/v1/duck/book/',
json.dumps(json_data), json.dumps(json_data),
HTTP_X_REQUESTED_WITH = 'XMLHttpRequest', HTTP_X_REQUESTED_WITH = 'XMLHttpRequest',
content_type = 'application/json') content_type = 'application/json')

View File

@ -1,6 +1,6 @@
from django.conf import settings
from django.conf.urls import patterns, include, url from django.conf.urls import patterns, include, url
from django.contrib import admin from django.contrib import admin
from django.conf import settings
from django.views.decorators.cache import cache_page from django.views.decorators.cache import cache_page
from django_js_reverse.views import urls_js from django_js_reverse.views import urls_js
@ -21,6 +21,6 @@ urlpatterns = patterns(
), ),
url(r'^admin/', include(admin.site.urls)), url(r'^admin/', include(admin.site.urls)),
url(r'^accounts/', include('accounts.urls', namespace = 'accounts')), url(r'^accounts/', include('accounts.urls', namespace = 'accounts')),
url(r'^api/', include('api.urls', namespace = 'api')), url(r'^api/v1/', include('api.urls', namespace = 'api')),
url('', include('booking.urls', namespace = 'booking')), url('', include('booking.urls', namespace = 'booking')),
) )