|
|
@ -578,6 +578,16 @@ class TestLogging(object): |
|
|
|
'index', |
|
|
|
'index', |
|
|
|
_scheme='https') |
|
|
|
_scheme='https') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_url_for_with_alternating_schemes(self): |
|
|
|
|
|
|
|
app = flask.Flask(__name__) |
|
|
|
|
|
|
|
@app.route('/') |
|
|
|
|
|
|
|
def index(): |
|
|
|
|
|
|
|
return '42' |
|
|
|
|
|
|
|
with app.test_request_context(): |
|
|
|
|
|
|
|
assert flask.url_for('index', _external=True) == 'http://localhost/' |
|
|
|
|
|
|
|
assert flask.url_for('index', _external=True, _scheme='https') == 'https://localhost/' |
|
|
|
|
|
|
|
assert flask.url_for('index', _external=True) == 'http://localhost/' |
|
|
|
|
|
|
|
|
|
|
|
def test_url_with_method(self): |
|
|
|
def test_url_with_method(self): |
|
|
|
from flask.views import MethodView |
|
|
|
from flask.views import MethodView |
|
|
|
app = flask.Flask(__name__) |
|
|
|
app = flask.Flask(__name__) |
|
|
|