Skip to content

Commit e17024e

Browse files
committed
Added a testcase for some more routing things between blueprints.
1 parent 681cb8f commit e17024e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

flask/testsuite/blueprints.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,25 @@ def backend_index():
445445
self.assert_equal(c.get('/fe2').data.strip(), b'/fe')
446446
self.assert_equal(c.get('/be').data.strip(), b'/fe')
447447

448+
def test_dotted_names_from_app(self):
449+
app = flask.Flask(__name__)
450+
app.testing = True
451+
test = flask.Blueprint('test', __name__)
452+
453+
@app.route('/')
454+
def app_index():
455+
return flask.url_for('test.index')
456+
457+
@test.route('/test/')
458+
def index():
459+
return flask.url_for('app_index')
460+
461+
app.register_blueprint(test)
462+
463+
with app.test_client() as c:
464+
rv = c.get('/')
465+
self.assert_equal(rv.data, b'/test/')
466+
448467
def test_empty_url_defaults(self):
449468
bp = flask.Blueprint('bp', __name__)
450469

0 commit comments

Comments
 (0)