Skip to content
Myr

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

2 files+12 added−9 removed

modified:tests/flask_tests.py+8 added-7 removed
14 unmodified lines
15import sys16import flask17import unittest18import tempfile19import warnings19from datetime import datetime20from werkzeug import parse_date2122
36 unmodified lines
59 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 == 405
15 unmodified lines
83 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 == 405
97 unmodified lines
189 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 lines
234 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 lines
296 assert rv.data == '3'297298 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>"'306307308class TemplatingTestCase(unittest.TestCase):
92 unmodified lines
modified:flask.py+4 added-2 removed
85 unmodified lines
86 pass878889class 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 """9394 def _get_permanent(self):95 return self.get('_permanent', False)9697 def _set_permanent(self, value):98 self['_permanent'] = bool(value)99100 permanent = property(_get_permanent, _set_permanent)101 del _get_permanent, _set_permanent102103
288 unmodified lines
392 #: To register a function here use the :meth:`after_request`393 #: decorator.394 self.after_request_funcs = []395394 #: 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