Url patterns
which provided by a django application should be addressed externally in the form of "namespace:name". I guess it will be connected to the project as follows:project/urls.py
urlpatterns = patterns('',
url('^something/', include('django_something.urls', namespace='something')))
URL patterns module in the application looks like:
django_something/urls.py
urlpatterns = patterns('',
url('^$', show, name='show'))
and I write a test:
django_something/tests.py
class ShowViewTest(TestCase):
urls = 'django_something.urls'
def test_should_render_something_template(self):
url = reverse('something:show') # !!!
response = self.client.get(url)
self.assertIn('something.html', set([
t.name for t in response.templates]))
This test failes with exception "django NoReverseMatch 'something' is not a registered namespace" .
How can I specify namespace 'something' in this case?