Browse Source

Merge branch '0.10-maintenance'

pull/957/merge
Armin Ronacher 11 years ago
parent
commit
53528ad2c3
  1. 2
      CHANGES
  2. 2
      flask/testing.py
  3. 14
      flask/testsuite/testing.py

2
CHANGES

@ -27,6 +27,8 @@ Version 0.10.2
without an `is_package()` method. without an `is_package()` method.
- Fixed an issue causing exceptions raised before entering a request or app - Fixed an issue causing exceptions raised before entering a request or app
context to be passed to teardown handlers. context to be passed to teardown handlers.
- Fixed an issue with query parameters getting removed from requests in
the test client when absolute URLs were requested.
Version 0.10.1 Version 0.10.1
-------------- --------------

2
flask/testing.py

@ -31,6 +31,8 @@ def make_test_environ_builder(app, path='/', base_url=None, *args, **kwargs):
base_url += app_root.lstrip('/') base_url += app_root.lstrip('/')
if url.netloc: if url.netloc:
path = url.path path = url.path
if url.query:
path += '?' + url.query
return EnvironBuilder(path, base_url, *args, **kwargs) return EnvironBuilder(path, base_url, *args, **kwargs)

14
flask/testsuite/testing.py

@ -196,6 +196,20 @@ class TestToolsTestCase(FlaskTestCase):
self.assert_equal(called, [None]) self.assert_equal(called, [None])
self.assert_equal(called, [None, None]) self.assert_equal(called, [None, None])
def test_full_url_request(self):
app = flask.Flask(__name__)
app.testing = True
@app.route('/action', methods=['POST'])
def action():
return 'x'
with app.test_client() as c:
rv = c.post('http://domain.com/action?vodka=42', data={'gin': 43})
self.assert_equal(rv.status_code, 200)
self.assert_('gin' in flask.request.form)
self.ssert_('vodka' in flask.request.args)
class SubdomainTestCase(FlaskTestCase): class SubdomainTestCase(FlaskTestCase):

Loading…
Cancel
Save