Commits

David Larlet committed 4ccee7c Merge

Merged in coagulant/django-oauth-plus/feature/test-fix-python-2.6.8-2.7.3 (pull request #9)

Fix testsuite for recent python 2.x versions (2.6.8+, 2.7.3+)

Comments (0)

Files changed (1)

oauth_provider/tests/auth.py

             print response
         self.assertEqual(response.status_code, 200)
 
-        self.assert_(
-            re.match(r'oauth_token_secret=[^&]+&oauth_token=[^&]+&oauth_callback_confirmed=true', response.content
-            ))
+        response_qs = parse_qs(response.content)
+        self.assert_(response_qs['oauth_token_secret'])
+        self.assert_(response_qs['oauth_token'])
+        self.assertEqual(response_qs['oauth_callback_confirmed'], ['true'])
 
         token = self.request_token = list(Token.objects.all())[-1]
         self.assert_(token.key in response.content)
 
     def test_access_token_with_post_request_body(self):
         self._request_token(METHOD_POST_REQUEST_BODY)
-        self._authorize_and_access_token_using_form(METHOD_POST_REQUEST_BODY)
+        self._authorize_and_access_token_using_form(METHOD_POST_REQUEST_BODY)