jarus / flask-testing

Unittest extensions for Flask
http://pythonhosted.org/Flask-Testing/
Other
501 stars 110 forks source link

Build URL using the SERVER_NAME config in assertRedirects #80

Closed ecarrara closed 8 years ago

ecarrara commented 9 years ago

Replace hard-coded "localhost" with SERVER_NAME config.

This allow to test applications using subdomain routes.

jcomo commented 8 years ago

I've suggested a possible solution here: https://github.com/jarus/flask-testing/issues/52. I think that using SERVER_URL is limiting since it would not allow checking for external redirects.

jcomo commented 8 years ago

Here is a solution that allows for both incorporating SERVER_NAME for relative paths and also allowing for external URLs https://github.com/jarus/flask-testing/commit/440252aba189edbfea42f4798ac00ae7ebd9ba33