Commit 3e1a9e66 by Piotr Mitros

More tests

parent 95e8dada
......@@ -22,9 +22,9 @@ from django.conf import settings
import re
def auth(f):
if 'DJA_AUTH' in settings.__dir__():
try:
dja = settings.DJA_AUTH
else:
except AttributeError:
dja = {}
for key in dja:
......
......@@ -79,3 +79,11 @@ class SimpleTest(TestCase):
self.assertEqual(g2(7), 48)
auth.settings = temp
def test_urls(self):
from django.test.client import Client
c = Client()
urls = ["/event_properties", "/schema"]
for url in urls:
response = c.get(url)
self.assertEqual(response.status_code, 200)
......@@ -5,9 +5,10 @@ urlpatterns = patterns('',
url(r'^view/([A-Za-z_+]+)$', 'djanalytics.core.views.handle_view'),
url(r'^query/([A-Za-z_+]+)$', 'djanalytics.core.views.handle_query'),
url(r'^schema$', 'djanalytics.core.views.schema'),
url(r'^probe$', 'djanalytics.core.views.handle_probe'),
url(r'^probe/([A-Za-z_+]+)$', 'djanalytics.core.views.handle_probe'),
url(r'^probe/([A-Za-z_+]+)/([A-Za-z_+]+)$', 'djanalytics.core.views.handle_probe'),
url(r'^probe/([A-Za-z_+]+)/([A-Za-z_+]+)/([A-Za-z_+]+)$', 'djanalytics.core.views.handle_probe'),
url(r'^probe/([A-Za-z_+]+)/([A-Za-z_+]+)/([A-Za-z_+]+)/([A-Za-z_+]+)$', 'djanalytics.core.views.handle_probe'),
url(r'^event_properties$', 'djanalytics.core.views.event_properties'),
# url(r'^probe$', 'djanalytics.core.views.handle_probe'),
# url(r'^probe/([A-Za-z_+]+)$', 'djanalytics.core.views.handle_probe'),
# url(r'^probe/([A-Za-z_+]+)/([A-Za-z_+]+)$', 'djanalytics.core.views.handle_probe'),
# url(r'^probe/([A-Za-z_+]+)/([A-Za-z_+]+)/([A-Za-z_+]+)$', 'djanalytics.core.views.handle_probe'),
# url(r'^probe/([A-Za-z_+]+)/([A-Za-z_+]+)/([A-Za-z_+]+)/([A-Za-z_+]+)$', 'djanalytics.core.views.handle_probe'),
)
......@@ -30,7 +30,7 @@ def index(request):
@auth.auth
def event_properties(request):
''' Adds a view to advertise defined event properties '''
from decorators import event_property_registry
from registry import event_property_registry
items = []
for key in event_property_registry.keys():
items.append("<di>{name}</di><dd>{doc}</dd>".format(**event_property_registry[key]))
......
......@@ -9,7 +9,6 @@ from django.contrib.auth.decorators import login_required
urlpatterns = patterns('',
# Examples:
url(r'^$', 'djanalytics.core.views.index'),
url(r'^event_properties$', 'djanalytics.core.views.event_properties'),
url('^', include('core.urls')),
url(r'^httpevent$', 'djeventstream.httphandler.views.http_view'),
# url(r'^view/([A-Za-z_+]+)/([A-Za-z_+]+)$', 'core.views.handle_view'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment