diff --git a/IPython/html/services/contents/tests/test_contents_api.py b/IPython/html/services/contents/tests/test_contents_api.py
index 36e849a..ac8f142 100644
--- a/IPython/html/services/contents/tests/test_contents_api.py
+++ b/IPython/html/services/contents/tests/test_contents_api.py
@@ -289,7 +289,7 @@ class APITest(NotebookTestBase):
self.assertEqual(model['format'], 'base64')
self.assertEqual(model['type'], 'file')
self.assertEqual(
- base64.decodestring(model['content']),
+ base64.decodestring(model['content'].encode('ascii')),
self._blob_for_name(name),
)