mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-04 08:01:34 -04:00
Merge pull request #1392 from alphagov/ken-update-org-logos-use-s3
Update org logos to use logo CDN
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
def test_owasp_useful_headers_set(client, mocker):
|
||||
mocker.patch('app.get_cdn_domain', return_value='static-logos.test.com')
|
||||
|
||||
def test_owasp_useful_headers_set(client):
|
||||
response = client.get('/')
|
||||
|
||||
assert response.status_code == 200
|
||||
assert response.headers['X-Frame-Options'] == 'deny'
|
||||
assert response.headers['X-Content-Type-Options'] == 'nosniff'
|
||||
@@ -10,6 +12,6 @@ def test_owasp_useful_headers_set(client):
|
||||
"script-src 'self' *.google-analytics.com 'unsafe-inline' 'unsafe-eval' data:;"
|
||||
"object-src 'self';"
|
||||
"font-src 'self' data:;"
|
||||
"img-src 'self' *.google-analytics.com *.notifications.service.gov.uk data:;"
|
||||
"img-src 'self' *.google-analytics.com *.notifications.service.gov.uk static-logos.test.com data:;"
|
||||
"frame-src www.youtube.com;"
|
||||
)
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
from pathlib import Path
|
||||
from io import StringIO
|
||||
from collections import OrderedDict
|
||||
from csv import DictReader
|
||||
|
||||
import pytest
|
||||
|
||||
from collections import OrderedDict
|
||||
from freezegun import freeze_time
|
||||
import pytest
|
||||
|
||||
from app.utils import (
|
||||
email_safe,
|
||||
@@ -14,10 +13,9 @@ from app.utils import (
|
||||
generate_next_dict,
|
||||
Spreadsheet,
|
||||
get_letter_timings,
|
||||
get_cdn_domain
|
||||
)
|
||||
|
||||
from tests import notification_json, single_notification_json
|
||||
|
||||
|
||||
def _get_notifications_csv(
|
||||
service_id,
|
||||
@@ -290,3 +288,15 @@ def test_get_estimated_delivery_date_for_letter(
|
||||
assert timings.is_printed == is_printed
|
||||
assert timings.earliest_delivery.strftime('%A %Y-%m-%d') == expected_earliest
|
||||
assert timings.latest_delivery.strftime('%A %Y-%m-%d') == expected_latest
|
||||
|
||||
|
||||
def test_get_cdn_domain_on_localhost(client, mocker):
|
||||
mocker.patch.dict('app.current_app.config', values={'ADMIN_BASE_URL': 'http://localhost:6012'})
|
||||
domain = get_cdn_domain()
|
||||
assert domain == 'static-logos.notify.tools'
|
||||
|
||||
|
||||
def test_get_cdn_domain_on_non_localhost(client, mocker):
|
||||
mocker.patch.dict('app.current_app.config', values={'ADMIN_BASE_URL': 'https://some.admintest.com'})
|
||||
domain = get_cdn_domain()
|
||||
assert domain == 'static-logos.admintest.com'
|
||||
|
||||
Reference in New Issue
Block a user