Commit Graph

43 Commits

Author SHA1 Message Date
David Lord cf5525f98a
add test_cli_runner for testing app.cli commands 2018-02-19 15:34:46 -08:00
David Lord 310fbfcf64
revert copyright year to project start
add copyright header to files
2018-02-08 12:43:30 -08:00
Hsiaoming Yang 22e072379b cleanup werkzeug import (#2582) 2018-01-06 10:49:01 +01:00
David Lord a89bdb3395
prefer the url's scheme over the kwarg
tabs -> spaces
add test
add changelog
2017-07-29 13:03:08 -07:00
Igor Kasianov 241673fd15 make_test_environ_builder: use url_scheme from path if provided
When providing https url in path ("https://example.com/")
we hope that we will get https scheme in environment
2017-07-27 14:50:27 +03:00
David Lord 59f7966e31 support passing environ to test client (#2412)
closes #2411
2017-07-13 08:42:53 -07:00
David Lord e97253e4c1
clean up JSON code and docs 2017-06-04 11:44:00 -07:00
David Lord dbc70c9274
Merge remote-tracking branch 'remotes/origin/master' into json-mixin 2017-06-04 09:42:39 -07:00
David Lord b9c8c9bad1
deprecate app session methods in favor of session_interface
ref #1182
2017-05-29 13:35:02 -07:00
David Lord 4a53840df0
APPLICATION_ROOT defaults to '/' 2017-05-28 14:08:53 -07:00
David Lord a37f675ccb
Merge remote-tracking branch 'origin/0.10-maintenance'
refactor make_test_environ_builder
2017-05-28 07:25:15 -07:00
Michael Recachinas bd5e297aa9 Default environ (#2047)
* Add init to FlaskClient

This addresses #1467. The init in the subclass
can now take in `environ_base`, which will then get
passed to `make_test_environ_builder` and to
`EnvironBuilder` via keyword args.

This should provide the default environment capability
on `app.test_client()` init.

* Add kwarg `environ_base` to `make_test_environ_builder` call

This change now passes `environ_base` from either
`kwargs` in `FlaskClient.open` or `FlaskClient.environ_base`
if passed into the init.

* Fix assignment reference typo

* Add default `environ_base` to `FlaskClient.__init__`

* Set default kwargs for `environ_base` in `FlaskClient.open`

* Remove specific environ_base kwarg since its in kwargs

* Add docstring to FlaskClient detailing environ_base

* Document app.test_client default environ in CHANGES

* Re-word environ_base changes in FlaskClient docstring

* Add client.environ_base tests

* Mention preset default environ in `app.test_client`

* Add versionchanged directive to docstring in FlaskClient
2016-10-12 08:54:24 +02:00
Markus Unterwaditzer 136a833a8d Bugfix: EnvironBuilder doesn't take `json` 2016-08-19 21:29:12 +02:00
Markus Unterwaditzer 62b0b6652a testing: Make json a keyword arg 2016-08-19 21:24:07 +02:00
Adam Byrtek b099999c6c Use proper exception type and update changelog 2016-08-19 21:14:12 +02:00
Adam Byrtek 6c5ef2bc5c Use `content_type` kwarg instead of manipulating headers 2016-08-19 21:13:33 +02:00
Adam Byrtek c4139e0e5d JSON support for the Flask test client 2016-08-19 21:13:33 +02:00
Benjamin Dopplinger 9f4c569c83 Fix "with" formatting in doc 2016-05-09 13:37:27 +10:00
Ivan Velichko daa3f272da Allow to specify subdomain and/or url_scheme in app.test_request_context() 2015-11-20 19:43:49 +03:00
Parkayun 33534bb4a9 Happy New Year 2015 2015-01-02 11:35:00 +09:00
Paulo Bu b81f72070e Fix warnings and code styling in the doc
There was a blank line missing that was generating a warning when
building the doc. Also, a removed function from cli.py was left in api.rst
(without_appcontext specifically) so this was also generating warnings.

Also corrects the format for a code block and adds a link to Werkzeug's Headers
class.
2014-08-28 16:51:53 +02:00
Armin Ronacher e7c587789a Fixe a bug in the test client causing url parameters to be removed. This fixes #968 2014-02-08 17:19:00 +00:00
Daniel Neuhäuser 52098e1e4f Happy New Year 2014 2014-01-02 19:21:07 +01:00
Armin Ronacher abc1505196 Fixed various issues on the Python 3 port 2013-05-30 15:07:18 +01:00
Thomas Waldmann 96b8ffbb29 always import from ._compat 2013-05-25 20:24:14 +02:00
Thomas Waldmann e1d356fb71 ported some more stuff to py 3.3
removed init_jinja_globals hack from app.py after consulting mitsuhiko
(didn't work on py 3.3 "as is")

removed with_statement future imports, not needed any more

needs more work on 2.7 as well as on 3.3
2013-05-22 01:33:04 +02:00
Armin Ronacher 4f1cb42123 make_test_environ_builder when used with subdomains was not working correctly, now it uses urlparse module for detecting full URL and changing path and base_url correctly 2012-10-07 12:48:19 +02:00
Armin Ronacher c6316132b1 Context preserving is now part of Flask and not the test client. This fixes #326 2011-09-24 20:27:38 +02:00
Armin Ronacher 7b899c8510 Merge pull request #309 from embe/master
Fix session loading in flask.testing.TestClient.session_transaction()
2011-09-07 02:44:08 -07:00
Armin Ronacher f92a275d54 Merge branch 'master' of github.com:mitsuhiko/flask 2011-09-01 19:51:37 +02:00
Ron DuPlain 37f9cb9ca6 Import with statement in testsuite, Python 2.5. 2011-09-01 12:35:04 -04:00
Armin Ronacher ee8417dac8 Late but 2010 -> 2011 in some files 2011-09-01 16:57:00 +02:00
Michał Bartoszkiewicz 4dc1796b1c Fixed session loading in flask.testing.TestClient.session_transaction() 2011-08-29 21:39:31 +02:00
Armin Ronacher d49221bf2e The test client now properly pops response contexts on __exit__ 2011-08-26 14:01:46 +01:00
Armin Ronacher c8ec453d86 Require that cookies are enabled in the test client for session transactions 2011-08-26 13:47:01 +01:00
Armin Ronacher e853a0f739 The test client and test_request_context are now both using the same logic internally for creating the environ. Also they use APPLICATION_ROOT now. 2011-08-25 20:47:50 +01:00
Armin Ronacher 311ac0f533 Ensure that nobody can nest test client invocations 2011-08-25 15:33:03 +01:00
Armin Ronacher a5da2c98f3 Implemented flask.testing.TestClient.session_transaction for quick session modifications in test environments. 2011-08-25 15:18:39 +01:00
Armin Ronacher 2866ccda1f Switch to explicit Werkzeug imports 2011-07-15 18:03:48 +02:00
Pedro Algarvio a327452540 Better handling for `test_request_context` don't just append the port.
Also implemented a proper initial environment to use with
`Flask.test_app()` based on the application's configuration.

Signed-off-by: Armin Ronacher <armin.ronacher@active-4.com>
2010-10-22 18:19:21 +03:00
Armin Ronacher 77e2fbf249 Added a separate logging module 2010-07-05 10:37:44 +02:00
Armin Ronacher e5d8202038 Added a docstring 2010-07-05 10:32:06 +02:00
Armin Ronacher df3f8940c3 Added separate module for testing 2010-07-05 10:31:18 +02:00