def test_token_endpoint_other(self): authreq = AuthorizationRequest(state="state", redirect_uri="http://example.com/authz", client_id="client1") _sdb = self.provider.sdb sid = _sdb.access_token.key(user="******", areq=authreq) access_grant = _sdb.access_token(sid=sid) _sdb[sid] = { "oauth_state": "authz", "sub": "sub", "authzreq": "", "client_id": "client1", "code": access_grant, "code_used": False, "redirect_uri": "http://example.com/authz", 'token_endpoint_auth_method': 'client_secret_basic', } areq = Message(grant_type='some_other') authn = 'Basic Y2xpZW50Mjp2ZXJ5c2VjcmV0=' with pytest.raises(UnSupported): self.provider.token_endpoint(request=areq.to_urlencoded(), authn=authn)