Fixed late binding of url_prefix. This fixes #29.

This commit is contained in:
Armin Ronacher 2010-05-04 11:41:54 +02:00
parent 720bede150
commit a921aef6c4
2 changed files with 10 additions and 1 deletions

View file

@ -441,6 +441,15 @@ class ModuleTestCase(unittest.TestCase):
assert catched == ['before-app', 'before-admin',
'after-admin', 'after-app']
def test_late_binding(self):
app = flask.Flask(__name__)
admin = flask.Module(__name__, 'admin')
@admin.route('/')
def index():
return '42'
app.register_module(admin, url_prefix='/admin')
assert app.test_client().get('/admin/').data == '42'
def suite():
from minitwit_tests import MiniTwitTestCase