from django.conf.urls import patterns, include from nap import api # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() api.autodiscover() urlpatterns = patterns('', (r'^admin/', include(admin.site.urls)), (r'^api/', include(api.patterns(True))), )
from django.conf.urls import patterns, include from nap import api api.autodiscover() urlpatterns = patterns( '', (r'^api/', include(api.patterns(True))), )
def test_register(self): self.assertTrue(len(api.APIS.keys()) == 0) api.register('v1', PollPublisher) self.assertTrue(len(api.APIS.keys()) == 1) self.assertTrue(len(api.patterns()) == 1)
def test_patterns(self): self.assertTrue(api.patterns() == [])
from django.conf.urls import patterns, include from nap import api api.autodiscover() urlpatterns = patterns("", (r"^api/", include(api.patterns(True))))