July 3rd - Fix landing page not display

This commit is contained in:
2026-07-03 21:15:29 -04:00
parent 4b6401be43
commit 372a1f090a
3 changed files with 40 additions and 15 deletions
+18
View File
@@ -23,6 +23,24 @@ def test_welcome_renders_landing(app):
assert b'Simple plans that grow with you' in r.data # pricing section
def test_apex_serves_landing_even_with_mt_disabled(app):
"""Regression guard: the apex landing must work in single-tenant mode too.
The base `app` fixture has MULTI_TENANT_ENABLED=False and the default
TENANT_BASE_DOMAIN='jqc.app'. Before the fix, the apex fell through to the
default database (tenant-zero) instead of the landing page.
"""
client = app.test_client()
r = client.get('/', headers={'Host': 'jqc.app'})
assert r.status_code == 200
assert b'Quality control for janitorial contracts' in r.data
# A non-root apex path still bounces back to '/' even with MT off.
r2 = client.get('/dashboard', headers={'Host': 'jqc.app'})
assert r2.status_code == 302
assert r2.headers['Location'] == '/'
@pytest.fixture
def mt_app(app):
"""The shared app with multi-tenancy temporarily enabled (apex = jqc.app).