diff options
| author | Michael Merickel <michael@merickel.org> | 2014-11-11 01:10:38 -0600 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2014-11-11 01:10:38 -0600 |
| commit | b59b01cdb3ab8a435d50e841a2c62ad393b56414 (patch) | |
| tree | bbf0009b2dde2de581060edcd66e2ea4ece21be4 | |
| parent | 1b584cf8850e9c75694b0aee7501a49c9c70de63 (diff) | |
| parent | 7a76cd0b183d5080ec863a7d494008e65469f683 (diff) | |
| download | pyramid-b59b01cdb3ab8a435d50e841a2c62ad393b56414.tar.gz pyramid-b59b01cdb3ab8a435d50e841a2c62ad393b56414.tar.bz2 pyramid-b59b01cdb3ab8a435d50e841a2c62ad393b56414.zip | |
Merge pull request #1446 from iElectric/guess_mimtype_test_fix
fixes #1405
| -rw-r--r-- | pyramid/tests/test_response.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/pyramid/tests/test_response.py b/pyramid/tests/test_response.py index a16eb8d33..84ec57757 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): |
