Browse Source

Added a testcase for some more routing things between blueprints.

pull/764/head
Armin Ronacher 12 years ago
parent
commit
e17024e85a
  1. 19
      flask/testsuite/blueprints.py

19
flask/testsuite/blueprints.py

@ -445,6 +445,25 @@ class BlueprintTestCase(FlaskTestCase):
self.assert_equal(c.get('/fe2').data.strip(), b'/fe') self.assert_equal(c.get('/fe2').data.strip(), b'/fe')
self.assert_equal(c.get('/be').data.strip(), b'/fe') self.assert_equal(c.get('/be').data.strip(), b'/fe')
def test_dotted_names_from_app(self):
app = flask.Flask(__name__)
app.testing = True
test = flask.Blueprint('test', __name__)
@app.route('/')
def app_index():
return flask.url_for('test.index')
@test.route('/test/')
def index():
return flask.url_for('app_index')
app.register_blueprint(test)
with app.test_client() as c:
rv = c.get('/')
self.assert_equal(rv.data, b'/test/')
def test_empty_url_defaults(self): def test_empty_url_defaults(self):
bp = flask.Blueprint('bp', __name__) bp = flask.Blueprint('bp', __name__)

Loading…
Cancel
Save