|
15 | 15 | import sys
|
16 | 16 | import flask
|
17 | 17 | import unittest
|
18 |
| -import tempfile |
19 | 18 | from logging import StreamHandler
|
20 | 19 | from contextlib import contextmanager
|
21 | 20 | from datetime import datetime
|
22 |
| -from werkzeug import parse_date, parse_options_header, http_date |
| 21 | +from werkzeug import parse_date, parse_options_header |
23 | 22 | from werkzeug.exceptions import NotFound
|
24 | 23 | from jinja2 import TemplateNotFound
|
25 | 24 | from cStringIO import StringIO
|
@@ -352,7 +351,7 @@ def after1(response):
|
352 | 351 | called.append(4)
|
353 | 352 | return response
|
354 | 353 | @app.after_request
|
355 |
| - def after1(response): |
| 354 | + def after2(response): |
356 | 355 | called.append(3)
|
357 | 356 | return response
|
358 | 357 | @app.route('/')
|
@@ -638,13 +637,13 @@ def test_basic_module(self):
|
638 | 637 | app = flask.Flask(__name__)
|
639 | 638 | admin = flask.Module(__name__, 'admin', url_prefix='/admin')
|
640 | 639 | @admin.route('/')
|
641 |
| - def index(): |
| 640 | + def admin_index(): |
642 | 641 | return 'admin index'
|
643 | 642 | @admin.route('/login')
|
644 |
| - def login(): |
| 643 | + def admin_login(): |
645 | 644 | return 'admin login'
|
646 | 645 | @admin.route('/logout')
|
647 |
| - def logout(): |
| 646 | + def admin_logout(): |
648 | 647 | return 'admin logout'
|
649 | 648 | @app.route('/')
|
650 | 649 | def index():
|
@@ -680,7 +679,7 @@ def after_admin_request(response):
|
680 | 679 | catched.append('after-admin')
|
681 | 680 | return response
|
682 | 681 | @admin.route('/')
|
683 |
| - def index(): |
| 682 | + def admin_index(): |
684 | 683 | return 'the admin'
|
685 | 684 | @app.before_request
|
686 | 685 | def before_request():
|
@@ -719,7 +718,7 @@ def inject_all_module():
|
719 | 718 | def index():
|
720 | 719 | return flask.render_template_string('{{ a }}{{ b }}{{ c }}')
|
721 | 720 | @admin.route('/')
|
722 |
| - def index(): |
| 721 | + def admin_index(): |
723 | 722 | return flask.render_template_string('{{ a }}{{ b }}{{ c }}')
|
724 | 723 | app.register_module(admin)
|
725 | 724 | c = app.test_client()
|
@@ -794,13 +793,13 @@ def test_safe_access(self):
|
794 | 793 | f = app.view_functions['admin.static']
|
795 | 794 |
|
796 | 795 | try:
|
797 |
| - rv = f('/etc/passwd') |
| 796 | + f('/etc/passwd') |
798 | 797 | except NotFound:
|
799 | 798 | pass
|
800 | 799 | else:
|
801 | 800 | assert 0, 'expected exception'
|
802 | 801 | try:
|
803 |
| - rv = f('../__init__.py') |
| 802 | + f('../__init__.py') |
804 | 803 | except NotFound:
|
805 | 804 | pass
|
806 | 805 | else:
|
@@ -914,7 +913,7 @@ def exc():
|
914 | 913 | c = app.test_client()
|
915 | 914 |
|
916 | 915 | with catch_stderr() as err:
|
917 |
| - rv = c.get('/') |
| 916 | + c.get('/') |
918 | 917 | out = err.getvalue()
|
919 | 918 | assert 'WARNING in flask_tests [' in out
|
920 | 919 | assert 'flask_tests.py' in out
|
@@ -1098,7 +1097,7 @@ def record(sender, template, context):
|
1098 | 1097 |
|
1099 | 1098 | flask.template_rendered.connect(record, app)
|
1100 | 1099 | try:
|
1101 |
| - rv = app.test_client().get('/') |
| 1100 | + app.test_client().get('/') |
1102 | 1101 | assert len(recorded) == 1
|
1103 | 1102 | template, context = recorded[0]
|
1104 | 1103 | assert template.name == 'simple_template.html'
|
|
0 commit comments