Blueprint view function name should not contain dots

This commit is contained in:
Caratpine 2017-08-19 11:41:03 +08:00 committed by David Lord
parent 0a1090890f
commit 2f57a0b917
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
3 changed files with 13 additions and 0 deletions

View file

@ -360,6 +360,15 @@ def test_route_decorator_custom_endpoint_with_dots(app, client):
lambda: None
)
foo_foo_foo.__name__ = 'bar.123'
pytest.raises(
AssertionError,
lambda: bp.add_url_rule(
'/bar/123', view_func=foo_foo_foo
)
)
app.register_blueprint(bp, url_prefix='/py')
assert client.get('/py/foo').data == b'bp.foo'