summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIan Foote <ian@incuna.com>2014-08-21 12:53:22 +0100
committerTim Graham <timograham@gmail.com>2014-08-22 20:07:12 -0400
commit03d89168a27f7c5a8fb4b466170c997aca5fdf02 (patch)
tree691aa8d3d2bdfc84897c10599f1b3f22a24581be /tests
parentf9c7732e964980bdb8bf805869ce8d2494007ea0 (diff)
Fixed #23333 -- Made urlsafe_base64_decode() return proper type on Python 3.
Diffstat (limited to 'tests')
-rw-r--r--tests/utils_tests/test_http.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/utils_tests/test_http.py b/tests/utils_tests/test_http.py
index 3f512ad80b..db24d1c9f2 100644
--- a/tests/utils_tests/test_http.py
+++ b/tests/utils_tests/test_http.py
@@ -119,6 +119,12 @@ class TestUtilsHttp(unittest.TestCase):
'/url%20with%20spaces/'):
self.assertTrue(http.is_safe_url(good_url, host='testserver'), "%s should be allowed" % good_url)
+ def test_urlsafe_base64_roundtrip(self):
+ bytestring = b'foo'
+ encoded = http.urlsafe_base64_encode(bytestring)
+ decoded = http.urlsafe_base64_decode(encoded)
+ self.assertEqual(bytestring, decoded)
+
class ETagProcessingTests(unittest.TestCase):
def test_parsing(self):