0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-28 08:48:04 +01:00

Check for the correct filename in document headers

This commit is contained in:
Tim Heap 2015-10-05 12:55:37 +11:00
parent a596fd82f1
commit 1d4b79f6aa

View File

@ -563,9 +563,10 @@ class TestServeView(TestCase):
def test_response_code(self):
self.assertEqual(self.get().status_code, 200)
@unittest.expectedFailure # Filename has a random string appended to it
def test_content_disposition_header(self):
self.assertEqual(self.get()['Content-Disposition'], 'attachment; filename=example.doc')
self.assertEqual(
self.get()['Content-Disposition'],
'attachment; filename="{}"'.format(self.document.filename))
def test_content_length_header(self):
self.assertEqual(self.get()['Content-Length'], '25')