Fix asset path in asset fingeprinter

The asset fingerprinter was hard coded to always point to `/static`.

It needs to change depending on which environment the app is running
in.
This commit is contained in:
Chris Hill-Scott
2018-11-29 13:06:10 +00:00
parent 9541c02309
commit dd711f51b3
3 changed files with 17 additions and 0 deletions

View File

@@ -241,3 +241,18 @@ def test_terms_tells_logged_in_users_what_we_know_about_their_agreement(
else:
assert not terms_page.select_one('main p').select('a')
assert normalize_spaces(pricing_page.select('main p')[-1].text) == expected_pricing_paragraph
def test_css_is_served_from_correct_path(client_request):
page = client_request.get('main.pricing') # easy static page
for index, link in enumerate(
page.select('link[rel=stylesheet]')
):
assert link['href'].startswith([
'https://static.example.com/stylesheets/govuk-template.css?',
'https://static.example.com/stylesheets/govuk-template-print.css?',
'https://static.example.com/stylesheets/fonts.css?',
'https://static.example.com/stylesheets/main.css?',
][index])