Check for the correct filename in document headers

pull/1794/head
Tim Heap 2015-10-05 12:55:37 +11:00
rodzic a596fd82f1
commit 1d4b79f6aa
1 zmienionych plików z 3 dodań i 2 usunięć
wagtail/wagtaildocs

Wyświetl plik

@ -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')