@urlmatch(netloc=MATCH_NETWORK_LOCATION, path=MATCH_OAUTH2_PATH, method='POST')
    def mock_oauth2_token(self, url, request):
        headers = {
            'Server': 'nginx',
            'Date': datetime.datetime.utcnow(),
            'Content-type': 'application/json;charset=UTF-8',
            'Connection': 'keep-alive',
            'Pragma': 'no-cache',
            'Cache-Control': 'no-store'
        }

        content = {
            'access_token': 's8KYRJGTO0rWMy0zz1CCSCwsSesDyDlbNdZoRqVR',
            'token_type': 'bearer',
            'expires': 1393350569,
            'expires_in': 3600
        }

        headers['Content-Length'] = len(json.dumps(content))

        return response(status_code=200, content=content, headers=headers, request=request)
Returns a mocked OAuth2 token response
dataset/ETHPy150Open pokitdok/pokitdok-python/tests/test_api_client.py/TestAPIClient.mock_oauth2_token