Update the testsuite to not freak out about a change in Werkzeug 0.8 that changed the behavior of misconfigured hosts.
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Armin Ronacher · committed by Armin Ronacher · parent f92a275 · Browse files · 1 file·+18 added−38 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+18 added−38 removed
- other:+18 added−38 removed
Provenance
- Commit
7331ae3- Tree
5689e65- Author
Armin Ronacher <armin.ronacher@active-4.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent
f92a275
1 file changed+18 added−38 removed
modified:flask/testsuite/basic.py+18 added-38 removed
700 unmodified lines701 @app.route('/', subdomain='foo')702 def subdomain():703 return 'Foo SubDomain'704 705- try:706- rv = app.test_client().get('/')707- self.assert_equal(rv.data, 'Foo')705+ rv = app.test_client().get('/')706+ self.assert_equal(rv.data, 'Foo')708- except ValueError, e:709- raise ValueError(710- "No ValueError exception should have been raised \"%s\"" % e711- )707 713- try:714- rv = app.test_client().get('/', 'http://localhost.localdomain:5000')715- self.assert_equal(rv.data, 'Foo')708+ rv = app.test_client().get('/', 'http://localhost.localdomain:5000')709+ self.assert_equal(rv.data, 'Foo')716- except ValueError, e:717- raise ValueError(718- "No ValueError exception should have been raised \"%s\"" % e719- )710 721- try:722- rv = app.test_client().get('/', 'https://localhost.localdomain:5000')723- self.assert_equal(rv.data, 'Foo')711+ rv = app.test_client().get('/', 'https://localhost.localdomain:5000')712+ self.assert_equal(rv.data, 'Foo')724- except ValueError, e:725- raise ValueError(726- "No ValueError exception should have been raised \"%s\"" % e727- )713 729- try:730- app.config.update(SERVER_NAME='localhost.localdomain')731- rv = app.test_client().get('/', 'https://localhost.localdomain')732- self.assert_equal(rv.data, 'Foo')714+ app.config.update(SERVER_NAME='localhost.localdomain')715+ rv = app.test_client().get('/', 'https://localhost.localdomain')716+ self.assert_equal(rv.data, 'Foo')733- except ValueError, e:734- raise ValueError(735- "No ValueError exception should have been raised \"%s\"" % e736- )717 718 try:719 app.config.update(SERVER_NAME='localhost.localdomain:443')720 rv = app.test_client().get('/', 'https://localhost.localdomain')721+ # Werkzeug 0.8741- self.assert_equal(rv.data, 'Foo')722+ self.assert_equal(rv.status_code, 404)723 except ValueError, e:724+ # Werkzeug 0.7725 self.assert_equal(str(e), "the server name provided " +726 "('localhost.localdomain:443') does not match the " + \727 "server name from the WSGI environment ('localhost.localdomain')")728 729 try:730 app.config.update(SERVER_NAME='localhost.localdomain')749- app.test_client().get('/', 'http://foo.localhost')731+ rv = app.test_client().get('/', 'http://foo.localhost')732+ # Werkzeug 0.8733+ self.assert_equal(rv.status_code, 404)734 except ValueError, e:735+ # Werkzeug 0.7736 self.assert_equal(str(e), "the server name provided " + \737 "('localhost.localdomain') does not match the " + \738 "server name from the WSGI environment ('foo.localhost')")739 755- try:756- rv = app.test_client().get('/', 'http://foo.localhost.localdomain')757- self.assert_equal(rv.data, 'Foo SubDomain')740+ rv = app.test_client().get('/', 'http://foo.localhost.localdomain')741+ self.assert_equal(rv.data, 'Foo SubDomain')758- except ValueError, e:759- raise ValueError(760- "No ValueError exception should have been raised \"%s\"" % e761- )742 743 def test_exception_propagation(self):744 def apprunner(configkey):745 app = flask.Flask(__name__)289 unmodified lines