none headers test
authorKenneth Reitz <me@kennethreitz.com>
Mon, 20 Feb 2012 17:31:52 +0000 (12:31 -0500)
committerKenneth Reitz <me@kennethreitz.com>
Mon, 20 Feb 2012 17:31:52 +0000 (12:31 -0500)
#433

tests/test_requests.py

index 7cfb7dedc155477fba309484d0ac47e4e4a899e2..eb3567b7104809f464d8bc2c9f55ca837dc5608a 100755 (executable)
@@ -782,5 +782,12 @@ class RequestsTestSuite(TestSetup, unittest.TestCase):
               get,
               'ftp://ftp.kernel.org/pub/')
 
+    def test_can_have_none_in_header_values(self):
+        try:
+            # Don't choke on headers with none in the value.
+            requests.get(httpbin('headers'), headers={'Foo': None})
+        except TypeError:
+            self.fail()
+
 if __name__ == '__main__':
     unittest.main()