Example #1
0
    def invalidate_authorization_code(self, client_id, code, request, *args,
                                      **kwargs):
        """Authorization codes are use once, invalidate it when a token has
        been acquired.

        """

        auth_api.authorization_code_delete(code)
    def test_delete_code(self):
        created_code = auth_codes.authorization_code_save(self.code_01)

        self.assertIsNotNone(created_code,
                             "Could not create an Authorization code")

        auth_codes.authorization_code_delete(created_code.code)

        fetched_code = auth_codes.authorization_code_get(created_code.code)
        self.assertIsNone(fetched_code)
Example #3
0
    def test_delete_code(self):
        created_code = auth_codes.authorization_code_save(self.code_01)

        self.assertIsNotNone(created_code,
                             "Could not create an Authorization code")

        auth_codes.authorization_code_delete(created_code.code)

        fetched_code = auth_codes.authorization_code_get(created_code.code)
        self.assertIsNone(fetched_code)