forked from pool/python-pyramid
New upstream release OBS-URL: https://build.opensuse.org/request/show/265045 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyramid?expand=0&rev=16
36 lines
1.2 KiB
Diff
36 lines
1.2 KiB
Diff
commit 7a76cd0b183d5080ec863a7d494008e65469f683
|
|
Author: Domen Kožar <domen@dev.si>
|
|
Date: Tue Nov 11 08:02:09 2014 +0100
|
|
|
|
fixes #1405
|
|
|
|
diff --git a/pyramid/tests/test_response.py b/pyramid/tests/test_response.py
|
|
index a16eb8d..84ec577 100644
|
|
--- a/pyramid/tests/test_response.py
|
|
+++ b/pyramid/tests/test_response.py
|
|
@@ -1,4 +1,5 @@
|
|
import io
|
|
+import mimetypes
|
|
import os
|
|
import unittest
|
|
from pyramid import testing
|
|
@@ -51,15 +52,11 @@ class TestFileResponse(unittest.TestCase):
|
|
r.app_iter.close()
|
|
|
|
def test_without_content_type(self):
|
|
- for suffix, content_type in (
|
|
- ('txt', 'text/plain; charset=UTF-8'),
|
|
- ('xml', 'application/xml; charset=UTF-8'),
|
|
- ('pdf', 'application/pdf')
|
|
- ):
|
|
+ for suffix in ('txt', 'xml', 'pdf'):
|
|
path = self._getPath(suffix)
|
|
r = self._makeOne(path)
|
|
- self.assertEqual(r.content_type, content_type.split(';')[0])
|
|
- self.assertEqual(r.headers['content-type'], content_type)
|
|
+ self.assertEqual(r.headers['content-type'].split(';')[0],
|
|
+ mimetypes.guess_type(path, strict=False)[0])
|
|
r.app_iter.close()
|
|
|
|
def test_python_277_bug_15207(self):
|