[Answer]-Failing functional test on GAE, Django, WebTest

1👍

The problem seems to be on the django.conf.urls.url function since I tested the root urls.py file and it worked for the root path / with no redirection, but it did redirected me with a path other than the root, I could find nothing that seemed being redirecting my urls on the Django source files.

I found an alternative on the Webtest documentation:

resp = self.testapp.get('/path')
resp = resp.maybe_follow()

with the maybe_follow method you eventually get the final page.

Edit

Finally I found the problem in this line:

response = self.testapp.get('/path')

replace it with this:

response = self.testapp.get('/path/')

It looks like Django redirects the urls to the propper path with the / at the end.

👤loki

Leave a comment