MCPcopy Create free account
hub / github.com/pallets/flask / test_nosubdomain

Function test_nosubdomain

tests/test_testing.py:321–335  ·  view source on GitHub ↗
(app, client)

Source from the content-addressed store, hash-verified

319
320
321def test_nosubdomain(app, client):
322 app.config["SERVER_NAME"] = "example.com"
323
324 @app.route("/<company_id>")
325 def view(company_id):
326 return company_id
327
328 with app.test_request_context():
329 url = flask.url_for("view", company_id="xxx")
330
331 with client:
332 response = client.get(url)
333
334 assert 200 == response.status_code
335 assert b"xxx" == response.data
336
337
338def test_cli_runner_class(app):

Callers

nothing calls this directly

Calls 3

test_request_contextMethod · 0.80
url_forMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected