()
| 289 | |
| 290 | |
| 291 | def test_subdomain(): |
| 292 | app = flask.Flask(__name__, subdomain_matching=True) |
| 293 | app.config["SERVER_NAME"] = "example.com" |
| 294 | client = app.test_client() |
| 295 | |
| 296 | @app.route("/", subdomain="<company_id>") |
| 297 | def view(company_id): |
| 298 | return company_id |
| 299 | |
| 300 | with app.test_request_context(): |
| 301 | url = flask.url_for("view", company_id="xxx") |
| 302 | |
| 303 | with client: |
| 304 | response = client.get(url) |
| 305 | |
| 306 | assert 200 == response.status_code |
| 307 | assert b"xxx" == response.data |
| 308 | |
| 309 | |
| 310 | def test_nosubdomain(app, client): |
nothing calls this directly
no test coverage detected