MCPcopy
hub / github.com/liangliangyy/DjangoBlog / test_oauth_login_test

Method test_oauth_login_test

oauth/tests.py:23–36  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

21 cache.clear()
22
23 def test_oauth_login_test(self):
24 c = OAuthConfig()
25 c.type = 'weibo'
26 c.appkey = 'appkey'
27 c.appsecret = 'appsecret'
28 c.save()
29
30 response = self.client.get('/oauth/oauthlogin?type=weibo')
31 self.assertEqual(response.status_code, 302)
32 self.assertTrue("api.weibo.com" in response.url)
33
34 response = self.client.get('/oauth/authorize?type=weibo&code=code')
35 self.assertEqual(response.status_code, 302)
36 self.assertEqual(response.url, '/')
37
38
39class OauthLoginTest(TestCase):

Callers

nothing calls this directly

Calls 3

OAuthConfigClass · 0.90
saveMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected