Fix some unicode related issues in oauth and the api.
authorElrond <elrond+mediagoblin.org@samba-tng.org>
Sun, 23 Dec 2012 22:55:44 +0000 (23:55 +0100)
committerElrond <elrond+mediagoblin.org@samba-tng.org>
Sun, 23 Dec 2012 22:55:44 +0000 (23:55 +0100)
Found using the previous commit.

mediagoblin/plugins/httpapiauth/__init__.py
mediagoblin/tests/test_api.py

index d3d2065e19772cb5e702480e587c399cdcd09814..081b590e99b46c2759c4682a4824e5242fe15d7e 100644 (file)
@@ -41,7 +41,7 @@ class HTTPAuth(Auth):
             return False
 
         user = request.db.User.query.filter_by(
-                username=request.authorization['username']).first()
+                username=unicode(request.authorization['username'])).first()
 
         if user.check_login(request.authorization['password']):
             request.user = user
index de61c68188354bcaf8e5d51279239a3961183b4c..188cdadb4e269b310d18c0eeb248c54d51fbab15 100644 (file)
@@ -101,4 +101,4 @@ class TestAPI(object):
 
         assert response.status_int == 200
 
-        assert self.db.MediaEntry.query.filter_by(title='Great JPG!').first()
+        assert self.db.MediaEntry.query.filter_by(title=u'Great JPG!').first()