From 9e1f79b6a2dc254a742746d58d8dd2748926490d Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 9 Dec 2015 22:23:06 +0000 Subject: [PATCH] Added test url definitions --- django_client_reverse/test_urls.py | 6 ++++++ django_client_reverse/urls.py | 8 ++++++++ runtests | 7 +++++++ 3 files changed, 21 insertions(+) create mode 100644 django_client_reverse/test_urls.py create mode 100644 runtests diff --git a/django_client_reverse/test_urls.py b/django_client_reverse/test_urls.py new file mode 100644 index 0000000..07e0512 --- /dev/null +++ b/django_client_reverse/test_urls.py @@ -0,0 +1,6 @@ +from django.conf.urls import include, url +from django_client_reverse.views import Reverser + +urlpatterns = [ + url(r'^$', Reverser.as_view(), name="reverser") +] diff --git a/django_client_reverse/urls.py b/django_client_reverse/urls.py index 8271555..d49d2bc 100644 --- a/django_client_reverse/urls.py +++ b/django_client_reverse/urls.py @@ -1,5 +1,13 @@ from django.conf.urls import include, url from .views import Reverser +from os import environ +from . import test_urls + urlpatterns = [ url(r'^$', Reverser.as_view(), name="reverser") ] + +if environ.get('IN_URL_TEST', False): + urlpatterns += [ + url(r'^tests/', include(test_urls, namespace="tests")) + ] diff --git a/runtests b/runtests new file mode 100644 index 0000000..147caff --- /dev/null +++ b/runtests @@ -0,0 +1,7 @@ +#!/usr/bin/bash + +set -e + +export IN_URL_TEST=true + +manage.py test $@