Url patterns which provided by a django application should be 
addressedexternally 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?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/gu-nerRvUugJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to