def test_static_url_no_filename(app): with app.test_request_context(): app.preprocess_request() try: static_url() assert False, "static_url without a filename should throw an error" except werkzeug.routing.BuildError: pass
def test_static_url(app) -> None: """Static URLs have the mtime appended.""" filename = "app.js" with app.test_request_context(): app.preprocess_request() url = static_url(filename) assert url.startswith("/static/" + filename) assert "?mtime=" in url
def test_static_url(app, filename, has_modified): with app.test_request_context(): app.preprocess_request() url = static_url(filename=filename) assert url.startswith('/static/' + filename) assert ('?mtime=' in url) == has_modified
def test_static_url(app: Flask) -> None: """Static URLs have the mtime appended.""" with app.test_request_context(): app.preprocess_request() url = static_url("app.js") assert url.startswith("/static/app.js?mtime=")