Filter out the request body in replay recordings.
authorJoshua Roesslein <jroesslein@gmail.com>
Wed, 21 Aug 2013 06:20:45 +0000 (23:20 -0700)
committerJoshua Roesslein <jroesslein@gmail.com>
Wed, 21 Aug 2013 06:20:45 +0000 (23:20 -0700)
- Prevents encoding errors when uploading binary data.

tests/config.py

index ac9f2ecc02ce89ddcf4ccdef7b7e22e3a3b07c63..ad152aa071beecbfcd387cd06841853a1c4d7493 100644 (file)
@@ -23,8 +23,10 @@ class TweepyTestCase(TestCase):
         self.api.retry_delay = 5
 
         if use_replay:
+            def filter_body(data): return ''
             start_replay('tests/record.json',
-                         headers_key=filter_headers_key(['Authorization']))
+                         headers_key=filter_headers_key(['Authorization']),
+                         body_key=filter_body)
 
     def tearDown(self):
         if use_replay: