Fix typo, remove useless import, limit lines to 79 columns.
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by florentx · committed by Armin Ronacher · parent f345af8 · Browse files · 2 files·+12 added−9 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+12 added−9 removed
- tests:+8 added−7 removed
- other:+4 added−2 removed
Provenance
- Commit
67fc465- Tree
eb3b05e- Author
florentx <florent.xicluna@gmail.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent
f345af8
2 files changed+12 added−9 removed
modified:tests/flask_tests.py+8 added-7 removed
14 unmodified lines15 import sys16 import flask17 import unittest18 import tempfile19-import warnings19 from datetime import datetime20 from werkzeug import parse_date21 22 36 unmodified lines59 assert rv.status_code == 40560 assert sorted(rv.allow) == ['GET', 'HEAD']61 rv = c.head('/')62 assert rv.status_code == 20064- assert not rv.data # head truncates63+ assert not rv.data # head truncates64 assert c.post('/more').data == 'POST'65 assert c.get('/more').data == 'GET'66 rv = c.delete('/more')67 assert rv.status_code == 40515 unmodified lines83 assert rv.status_code == 40584 assert sorted(rv.allow) == ['GET', 'HEAD']85 rv = c.head('/')86 assert rv.status_code == 20088- assert not rv.data # head truncates87+ assert not rv.data # head truncates88 assert c.post('/more').data == 'POST'89 assert c.get('/more').data == 'GET'90 rv = c.delete('/more')91 assert rv.status_code == 40597 unmodified lines189 def index():190 flask.abort(404)191 @app.route('/error')192 def error():194- 1/0193+ 1 // 0194 c = app.test_client()195 rv = c.get('/')196 assert rv.status_code == 404197 assert rv.data == 'not found'36 unmodified lines234 class ListConverter(BaseConverter):235 def to_python(self, value):236 return value.split(',')237 def to_url(self, value):238+ base_to_url = super(ListConverter, self).to_url239- return ','.join(super(ListConverter, self).to_url(x) for x in value)239+ return ','.join(base_to_url(x) for x in value)240 app = flask.Flask(__name__)241 app.url_map.converters['list'] = ListConverter242 @app.route('/<list:args>')243 def index(args):52 unmodified lines296 assert rv.data == '3'297 298 def test_template_escaping(self):299 app = flask.Flask(__name__)300+ render = flask.render_template_string301 with app.test_request_context():301- rv = flask.render_template_string('{{ "</script>"|tojson|safe }}')302+ rv = render('{{ "</script>"|tojson|safe }}')303 assert rv == '"<\\/script>"'303- rv = flask.render_template_string('{{ "<\0/script>"|tojson|safe }}')304+ rv = render('{{ "<\0/script>"|tojson|safe }}')305 assert rv == '"<\\u0000\\/script>"'306 307 308 class TemplatingTestCase(unittest.TestCase):92 unmodified linesmodified:flask.py+4 added-2 removed
85 unmodified lines86 pass87 88 89 class Session(SecureCookie):90- """Expands the session for support for switching between permanent90+ """Expands the session with support for switching between permanent91 and non-permanent sessions.92 """93 94 def _get_permanent(self):95 return self.get('_permanent', False)96+97 def _set_permanent(self, value):98 self['_permanent'] = bool(value)99+100 permanent = property(_get_permanent, _set_permanent)101 del _get_permanent, _set_permanent102 103 288 unmodified lines392 #: To register a function here use the :meth:`after_request`393 #: decorator.394 self.after_request_funcs = []395 394- #: a list of functions that are called without arguments396+ #: a list of functions that are called without argument397 #: to populate the template context. Each returns a dictionary398 #: that the template context is updated with.399 #: To register a function here, use the :meth:`context_processor`400 #: decorator.452 unmodified lines