diff options
author | Sebastian Spaeth <Sebastian@SSpaeth.de> | 2012-12-12 12:29:22 +0100 |
---|---|---|
committer | Sebastian Spaeth <Sebastian@SSpaeth.de> | 2012-12-12 12:35:26 +0100 |
commit | af6a43d140cd65989a6fe151f9df7bdafc622546 (patch) | |
tree | 2dec98beebb508675cde9590be9e50355ad9e060 /mediagoblin | |
parent | 8ba4380ff72a3d21c0b0d8c876c39cbb50a2f922 (diff) | |
download | mediagoblin-af6a43d140cd65989a6fe151f9df7bdafc622546.tar.lz mediagoblin-af6a43d140cd65989a6fe151f9df7bdafc622546.tar.xz mediagoblin-af6a43d140cd65989a6fe151f9df7bdafc622546.zip |
More unicode fixes in the test suite
Pass in unicode not (binary) strings where sqlite expects unicode
values to prevent the test suite from (correctly) complaining about
errors.
I now pass the full suite without any complaints.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Diffstat (limited to 'mediagoblin')
-rw-r--r-- | mediagoblin/tests/test_oauth.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/mediagoblin/tests/test_oauth.py b/mediagoblin/tests/test_oauth.py index cedfc42a..a72f766e 100644 --- a/mediagoblin/tests/test_oauth.py +++ b/mediagoblin/tests/test_oauth.py @@ -59,13 +59,13 @@ class TestOAuth(object): def test_1_public_client_registration_without_redirect_uri(self): ''' Test 'public' OAuth client registration without any redirect uri ''' - response = self.register_client('OMGOMGOMG', 'public', + response = self.register_client(u'OMGOMGOMG', 'public', 'OMGOMG Apache License v2') ctx = self.get_context('oauth/client/register.html') client = self.db.OAuthClient.query.filter( - self.db.OAuthClient.name == 'OMGOMGOMG').first() + self.db.OAuthClient.name == u'OMGOMGOMG').first() assert response.status_int == 200 @@ -78,23 +78,23 @@ class TestOAuth(object): def test_2_successful_public_client_registration(self): ''' Successfully register a public client ''' self.login() - self.register_client('OMGOMG', 'public', 'OMG!', + self.register_client(u'OMGOMG', 'public', 'OMG!', 'http://foo.example') client = self.db.OAuthClient.query.filter( - self.db.OAuthClient.name == 'OMGOMG').first() + self.db.OAuthClient.name == u'OMGOMG').first() # Client should have been registered assert client def test_3_successful_confidential_client_reg(self): ''' Register a confidential OAuth client ''' - response = self.register_client('GMOGMO', 'confidential', 'NO GMO!') + response = self.register_client(u'GMOGMO', 'confidential', 'NO GMO!') assert response.status_int == 302 client = self.db.OAuthClient.query.filter( - self.db.OAuthClient.name == 'GMOGMO').first() + self.db.OAuthClient.name == u'GMOGMO').first() # Client should have been registered assert client @@ -103,6 +103,7 @@ class TestOAuth(object): def test_4_authorize_confidential_client(self): ''' Authorize a confidential client as a logged in user ''' + client = self.test_3_successful_confidential_client_reg() client_identifier = client.identifier |