def test_flow(self):
        self.client.login(username="test", password="test")
        
        authorization_url = self.service.get_authorize_url(**{
            "redirect_uri": self.redirect_uri.url,
            "response_type": "code",
            "scope": self.scope.short_name,
            "state": "test_state",
        })
        
        response = self.client.get(authorization_url)
        
        self.assertEqual(response.status_code, 200)
        self.assertTemplateUsed(response, "doac/authorize.html")
        
        approval_url = reverse("oauth2_approval") + "?code=" + self.authorization_code.token
        
        response = self.client.post(approval_url, {
            "code": self.authorization_code.token,
            "code_state": "test_state",
            "approve_access": None,
        })
        
        authorization_token = AuthorizationToken.objects.all()[0]
dataset/ETHPy150Open Rediker-Software/doac/tests/tests/integrations/test_litl_rauth.py/TestRauth.test_flow/original