Fix url_for references and improve navigation
Issues fixed:
- Fixed base.html to use url_for('landing.index') instead of url_for('index')
- Fixed error_403.html and error_404.html to use correct landing page endpoint
- Added Dashboard link in base.html nav for product owners
- Removed obsolete templates/index.html (replaced by landing page)
- Added dashboard link in landing/index.html for authenticated product owners
- Added test to verify landing page renders correctly with proper url_for references
All 8 landing page tests passing.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -164,3 +164,19 @@ def test_get_landing_page_missing_slug(client, test_products):
|
||||
assert b'No Slug Product' not in response.data
|
||||
# But other active products should appear
|
||||
assert b'Apple Product' in response.data
|
||||
|
||||
|
||||
@pytest.mark.contract
|
||||
def test_landing_page_with_authenticated_user_renders_correctly(client, test_products, app):
|
||||
"""Test that landing page renders correctly - verifies url_for('landing.index') works
|
||||
|
||||
This test verifies that the base.html template references url_for('landing.index')
|
||||
instead of url_for('index'), which would cause a BuildError.
|
||||
"""
|
||||
# Just access the landing page - if url_for references are broken, this will fail
|
||||
response = client.get('/')
|
||||
|
||||
assert response.status_code == 200
|
||||
# Should contain products (proving the page rendered successfully)
|
||||
assert b'Apple Product' in response.data
|
||||
assert b'Zebra Product' in response.data
|
||||
|
||||
Reference in New Issue
Block a user