kopia lustrzana https://gitlab.com/marnanel/chapeau
Fixed up test_headers so it passes. Old config variable name updated, and a bunch of standard headers that no longer exist removed.
rodzic
e8037ce402
commit
baabe28692
|
@ -9,6 +9,7 @@ logger = logging.getLogger(name="kepi")
|
||||||
|
|
||||||
from django.test import TestCase, Client
|
from django.test import TestCase, Client
|
||||||
from kepi.trilby_api.tests import create_local_person
|
from kepi.trilby_api.tests import create_local_person
|
||||||
|
from kepi.bowler_pub.utils import uri_to_url
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from unittest import skip
|
from unittest import skip
|
||||||
|
|
||||||
|
@ -20,10 +21,9 @@ class TestHeaders(TestCase):
|
||||||
settings.KEPI['LOCAL_OBJECT_HOSTNAME'] = 'testserver'
|
settings.KEPI['LOCAL_OBJECT_HOSTNAME'] = 'testserver'
|
||||||
self.alice = create_local_person('alice')
|
self.alice = create_local_person('alice')
|
||||||
self.client = Client()
|
self.client = Client()
|
||||||
self.alice_url = settings.KEPI['USER_URL_FORMAT'] % {
|
self.alice_url = uri_to_url(settings.KEPI['USER_LINK'] % {
|
||||||
'username': 'alice',
|
'username': 'alice',
|
||||||
'hostname': settings.KEPI['LOCAL_OBJECT_HOSTNAME'],
|
})
|
||||||
}
|
|
||||||
|
|
||||||
def test_link(self):
|
def test_link(self):
|
||||||
|
|
||||||
|
@ -55,12 +55,6 @@ class TestHeaders(TestCase):
|
||||||
|
|
||||||
for field, value in [
|
for field, value in [
|
||||||
('X-Content-Type-Options', 'nosniff'),
|
('X-Content-Type-Options', 'nosniff'),
|
||||||
('X-XSS-Protection', '1; mode=block'),
|
|
||||||
('Vary', 'Accept, Accept-Encoding, Origin'),
|
|
||||||
('Cache-Control', 'max-age=180, public'),
|
|
||||||
('Transfer-Encoding', 'chunked'),
|
|
||||||
('Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload'),
|
|
||||||
('Referrer-Policy', 'no-referrer-when-downgrade'),
|
|
||||||
('X-Frame-Options', 'DENY'),
|
('X-Frame-Options', 'DENY'),
|
||||||
]:
|
]:
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue