I'm working on tests for a Django app that I'm contributing to the 
community (https://github.com/jondbaker/django-critique) and have become 
stuck on a problem. After I perform a GET request for the app's sole URL 
within my integration tests:

response = self.client.get(reverse("critique_create"))

The response.status_code is 404 and the content:

"The requested URL /critique/create/ was not found on this server."

As you can see, the URL is being successfully reversed, but then it 404s. 
I've created a separate test URL/view/template that plays nicely, but I 
can't figure out what's going on with the /critique/create/ URL.

Any help would be greatly appreciated.

*tests/urls.py*
try:
    from django.conf.urls import include, patterns, url
except ImportError:  # django < 1.4
    from django.conf.urls.default import include, patterns, url

from .views import TestView

urlpatterns = patterns(
    "",
    url(r"^test/$", TestView.as_view(), name="test_view"),
    url(r"^", include("critique.urls")),
)

*critique/urls.py*
try:
    from django.conf.urls import patterns, url
except ImportError:  # django < 1.4
    from django.conf.urls.default import patterns, url

urlpatterns = patterns(
    "",
    url(r"^critique/create/$", "critique.views.create", 
name="critique_create"),
)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to