def test_invalid_key_and_secret(self): # 値によっては Server Error j_not_found = sc.access_auth_view( self.client, access_token_key='spam', access_token_secret='egg') self.assertEqual(j_not_found['status'], 'Server Error')
def test_auth_only_secret(self): j_only_secret = sc.access_auth_view( self.client, access_token_secret='BAD_REQUEST_SECRET') self.assertEqual(j_only_secret['status'], 'Bad Request')
def test_auth_only_key(self): j_only_key = sc.access_auth_view( self.client, access_token_key='BAD_REQUEST_KEY') self.assertEqual(j_only_key['status'], 'Bad Request')
def test_access_auth_view_second(self): # second log-in user sc.access_auth_view(self.client) client2 = Client() j_auth2 = sc.access_auth_view(client2) self.assertFalse(j_auth2['created'])
def test_access_auth_view(self): j_auth = sc.access_auth_view(self.client) self.assertEqual(j_auth['status'], 'OK')
def test_achievement_first_login(self): self.client.logout() # access_auth_viewを使うため一旦ログアウト sc.access_auth_view(self.client) j_first = get_achevements_from_db(user_pk=3)[0] self.assertEqual(j_first['point'], 100)