Skip to content
GitHub Actions / Backend Test Results succeeded Dec 9, 2024 in 0s

16 fail, 433 pass in 1m 51s

449 tests  ±0   433 ✅ +1   1m 51s ⏱️ -4s
  1 suites ±0     0 💤 ±0 
  1 files   ±0    16 ❌  - 1 

Results for commit 4895bb8. ± Comparison against earlier commit 9045966.

Annotations

Check warning on line 0 in lcfs.tests.compliance_report.test_compliance_report_views

See this annotation in the file changed.

@github-actions github-actions / Backend Test Results

test_update_compliance_report_success (lcfs.tests.compliance_report.test_compliance_report_views) failed

backend/pytest-results.xml [took 0s]
Raw output
ValueError: Missing configuration: AUTH_URL, EMAIL_URL, CLIENT_ID, CLIENT_SECRET
client = <httpx.AsyncClient object at 0x7ff6aeb5ae00>
fastapi_app = <fastapi.applications.FastAPI object at 0x7ff6afe4ac20>
compliance_report_base_schema = <function compliance_report_base_schema.<locals>._create_compliance_report_base_schema at 0x7ff6af95b400>
set_mock_user = <function set_mock_user.<locals>._set_mock_auth at 0x7ff6afcab490>

    @pytest.mark.anyio
    async def test_update_compliance_report_success(
        client: AsyncClient,
        fastapi_app: FastAPI,
        compliance_report_base_schema,
        set_mock_user,
    ):
        with patch(
            "lcfs.web.api.compliance_report.views.ComplianceReportUpdateService.update_compliance_report"
        ) as mock_update_compliance_report, patch(
            "lcfs.web.api.compliance_report.views.ComplianceReportValidation.validate_organization_access"
        ) as mock_validate_organization_access:
            set_mock_user(fastapi_app, [RoleEnum.GOVERNMENT])
    
            mock_compliance_report = compliance_report_base_schema()
            mock_validate_organization_access.return_value = None
            mock_update_compliance_report.return_value = mock_compliance_report
    
            url = fastapi_app.url_path_for(
                "update_compliance_report",
                report_id=1,
            )
    
            payload = {"status": "Draft", "supplementalNote": "new supplemental note"}
    
>           response = await client.put(url, json=payload)

lcfs/tests/compliance_report/test_compliance_report_views.py:524: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1885: in put
    return await self.request(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1533: in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1620: in send
    response = await self._send_handling_auth(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1648: in _send_handling_auth
    response = await self._send_handling_redirects(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1685: in _send_handling_redirects
    response = await self._send_single_request(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1722: in _send_single_request
    response = await transport.handle_async_request(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_transports/asgi.py:162: in handle_async_request
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/applications.py:1054: in __call__
    await super().__call__(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/applications.py:113: in __call__
    await self.middleware_stack(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/errors.py:187: in __call__
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/errors.py:165: in __call__
    await self.app(scope, receive, _send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/authentication.py:48: in __call__
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/cors.py:85: in __call__
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/exceptions.py:62: in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:715: in __call__
    await self.middleware_stack(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:735: in app
    await route.handle(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:288: in handle
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:76: in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:73: in app
    response = await f(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/routing.py:291: in app
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:615: in solve_dependencies
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:615: in solve_dependencies
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:640: in solve_dependencies
    solved = await run_in_threadpool(call, **solved_result.values)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/concurrency.py:39: in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/to_thread.py:33: in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py:877: in run_sync_in_worker_thread
    return await future
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py:807: in run
    result = context.run(func, *args)
lcfs/web/api/email/services.py:38: in __init__
    self._validate_configuration()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <lcfs.web.api.email.services.CHESEmailService object at 0x7ff6aeb444f0>

    def _validate_configuration(self):
        """
        Validate the CHES configuration to ensure all necessary environment variables are set.
        """
        missing = [key for key, value in self.config.items() if not value]
        if missing:
>           raise ValueError(f"Missing configuration: {', '.join(missing)}")
E           ValueError: Missing configuration: AUTH_URL, EMAIL_URL, CLIENT_ID, CLIENT_SECRET

lcfs/web/api/email/services.py:53: ValueError

Check warning on line 0 in lcfs.tests.compliance_report.test_compliance_report_views

See this annotation in the file changed.

@github-actions github-actions / Backend Test Results

test_update_compliance_report_forbidden (lcfs.tests.compliance_report.test_compliance_report_views) failed

backend/pytest-results.xml [took 0s]
Raw output
ValueError: Missing configuration: AUTH_URL, EMAIL_URL, CLIENT_ID, CLIENT_SECRET
client = <httpx.AsyncClient object at 0x7ff6ae473100>
fastapi_app = <fastapi.applications.FastAPI object at 0x7ff6ae4721a0>
set_mock_user = <function set_mock_user.<locals>._set_mock_auth at 0x7ff6aed197e0>

    @pytest.mark.anyio
    async def test_update_compliance_report_forbidden(
        client: AsyncClient,
        fastapi_app: FastAPI,
        set_mock_user,
    ):
        set_mock_user(fastapi_app, [RoleEnum.ANALYST])
    
        url = fastapi_app.url_path_for("update_compliance_report", report_id=1)
    
        payload = {"status": "Draft", "supplementalNote": "new supplemental note"}
    
>       response = await client.put(url, json=payload)

lcfs/tests/compliance_report/test_compliance_report_views.py:550: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1885: in put
    return await self.request(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1533: in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1620: in send
    response = await self._send_handling_auth(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1648: in _send_handling_auth
    response = await self._send_handling_redirects(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1685: in _send_handling_redirects
    response = await self._send_single_request(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1722: in _send_single_request
    response = await transport.handle_async_request(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_transports/asgi.py:162: in handle_async_request
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/applications.py:1054: in __call__
    await super().__call__(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/applications.py:113: in __call__
    await self.middleware_stack(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/errors.py:187: in __call__
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/errors.py:165: in __call__
    await self.app(scope, receive, _send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/authentication.py:48: in __call__
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/cors.py:85: in __call__
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/exceptions.py:62: in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:715: in __call__
    await self.middleware_stack(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:735: in app
    await route.handle(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:288: in handle
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:76: in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:73: in app
    response = await f(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/routing.py:291: in app
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:615: in solve_dependencies
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:615: in solve_dependencies
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:640: in solve_dependencies
    solved = await run_in_threadpool(call, **solved_result.values)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/concurrency.py:39: in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/to_thread.py:33: in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py:877: in run_sync_in_worker_thread
    return await future
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py:807: in run
    result = context.run(func, *args)
lcfs/web/api/email/services.py:38: in __init__
    self._validate_configuration()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <lcfs.web.api.email.services.CHESEmailService object at 0x7ff6aebe00a0>

    def _validate_configuration(self):
        """
        Validate the CHES configuration to ensure all necessary environment variables are set.
        """
        missing = [key for key, value in self.config.items() if not value]
        if missing:
>           raise ValueError(f"Missing configuration: {', '.join(missing)}")
E           ValueError: Missing configuration: AUTH_URL, EMAIL_URL, CLIENT_ID, CLIENT_SECRET

lcfs/web/api/email/services.py:53: ValueError

Check warning on line 0 in lcfs.tests.compliance_report.test_compliance_report_views

See this annotation in the file changed.

@github-actions github-actions / Backend Test Results

test_update_compliance_report_not_found (lcfs.tests.compliance_report.test_compliance_report_views) failed

backend/pytest-results.xml [took 0s]
Raw output
ValueError: Missing configuration: AUTH_URL, EMAIL_URL, CLIENT_ID, CLIENT_SECRET
client = <httpx.AsyncClient object at 0x7ff6aee1b490>
fastapi_app = <fastapi.applications.FastAPI object at 0x7ff6aee1b8b0>
set_mock_user = <function set_mock_user.<locals>._set_mock_auth at 0x7ff6affe7130>

    @pytest.mark.anyio
    async def test_update_compliance_report_not_found(
        client: AsyncClient,
        fastapi_app: FastAPI,
        set_mock_user,
    ):
        with patch(
            "lcfs.web.api.compliance_report.views.ComplianceReportUpdateService.update_compliance_report"
        ) as mock_update_compliance_report:
            set_mock_user(fastapi_app, [RoleEnum.GOVERNMENT])
    
            # Simulate that the report does not exist by raising an exception
            mock_update_compliance_report.side_effect = DataNotFoundException(
                "Compliance report not found"
            )
    
            url = fastapi_app.url_path_for(
                "update_compliance_report", report_id=0
            )  # Non-existent ID
    
            payload = {"status": "Draft", "supplementalNote": "new supplemental note"}
    
>           response = await client.put(url, json=payload)

lcfs/tests/compliance_report/test_compliance_report_views.py:577: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1885: in put
    return await self.request(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1533: in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1620: in send
    response = await self._send_handling_auth(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1648: in _send_handling_auth
    response = await self._send_handling_redirects(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1685: in _send_handling_redirects
    response = await self._send_single_request(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1722: in _send_single_request
    response = await transport.handle_async_request(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_transports/asgi.py:162: in handle_async_request
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/applications.py:1054: in __call__
    await super().__call__(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/applications.py:113: in __call__
    await self.middleware_stack(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/errors.py:187: in __call__
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/errors.py:165: in __call__
    await self.app(scope, receive, _send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/authentication.py:48: in __call__
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/cors.py:85: in __call__
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/exceptions.py:62: in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:715: in __call__
    await self.middleware_stack(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:735: in app
    await route.handle(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:288: in handle
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:76: in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:73: in app
    response = await f(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/routing.py:291: in app
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:615: in solve_dependencies
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:615: in solve_dependencies
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:640: in solve_dependencies
    solved = await run_in_threadpool(call, **solved_result.values)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/concurrency.py:39: in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/to_thread.py:33: in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py:877: in run_sync_in_worker_thread
    return await future
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py:807: in run
    result = context.run(func, *args)
lcfs/web/api/email/services.py:38: in __init__
    self._validate_configuration()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <lcfs.web.api.email.services.CHESEmailService object at 0x7ff6af104640>

    def _validate_configuration(self):
        """
        Validate the CHES configuration to ensure all necessary environment variables are set.
        """
        missing = [key for key, value in self.config.items() if not value]
        if missing:
>           raise ValueError(f"Missing configuration: {', '.join(missing)}")
E           ValueError: Missing configuration: AUTH_URL, EMAIL_URL, CLIENT_ID, CLIENT_SECRET

lcfs/web/api/email/services.py:53: ValueError

Check warning on line 0 in lcfs.tests.compliance_report.test_compliance_report_views

See this annotation in the file changed.

@github-actions github-actions / Backend Test Results

test_update_compliance_report_invalid_payload (lcfs.tests.compliance_report.test_compliance_report_views) failed

backend/pytest-results.xml [took 0s]
Raw output
ValueError: Missing configuration: AUTH_URL, EMAIL_URL, CLIENT_ID, CLIENT_SECRET
client = <httpx.AsyncClient object at 0x7ff6ae471570>
fastapi_app = <fastapi.applications.FastAPI object at 0x7ff6aee1bac0>
set_mock_user = <function set_mock_user.<locals>._set_mock_auth at 0x7ff6af958700>

    @pytest.mark.anyio
    async def test_update_compliance_report_invalid_payload(
        client: AsyncClient,
        fastapi_app: FastAPI,
        set_mock_user,
    ):
        set_mock_user(fastapi_app, [RoleEnum.GOVERNMENT])
    
        url = fastapi_app.url_path_for("update_compliance_report", report_id=1)
        payload = {"invalidField": "invalidValue"}  # Invalid payload structure
    
>       response = await client.put(url, json=payload)

lcfs/tests/compliance_report/test_compliance_report_views.py:594: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1885: in put
    return await self.request(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1533: in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1620: in send
    response = await self._send_handling_auth(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1648: in _send_handling_auth
    response = await self._send_handling_redirects(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1685: in _send_handling_redirects
    response = await self._send_single_request(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1722: in _send_single_request
    response = await transport.handle_async_request(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_transports/asgi.py:162: in handle_async_request
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/applications.py:1054: in __call__
    await super().__call__(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/applications.py:113: in __call__
    await self.middleware_stack(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/errors.py:187: in __call__
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/errors.py:165: in __call__
    await self.app(scope, receive, _send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/authentication.py:48: in __call__
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/cors.py:85: in __call__
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/exceptions.py:62: in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:715: in __call__
    await self.middleware_stack(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:735: in app
    await route.handle(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:288: in handle
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:76: in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:73: in app
    response = await f(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/routing.py:291: in app
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:615: in solve_dependencies
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:615: in solve_dependencies
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:640: in solve_dependencies
    solved = await run_in_threadpool(call, **solved_result.values)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/concurrency.py:39: in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/to_thread.py:33: in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py:877: in run_sync_in_worker_thread
    return await future
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py:807: in run
    result = context.run(func, *args)
lcfs/web/api/email/services.py:38: in __init__
    self._validate_configuration()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <lcfs.web.api.email.services.CHESEmailService object at 0x7ff6adac9d50>

    def _validate_configuration(self):
        """
        Validate the CHES configuration to ensure all necessary environment variables are set.
        """
        missing = [key for key, value in self.config.items() if not value]
        if missing:
>           raise ValueError(f"Missing configuration: {', '.join(missing)}")
E           ValueError: Missing configuration: AUTH_URL, EMAIL_URL, CLIENT_ID, CLIENT_SECRET

lcfs/web/api/email/services.py:53: ValueError

Check warning on line 0 in lcfs.tests.compliance_report.test_compliance_report_views

See this annotation in the file changed.

@github-actions github-actions / Backend Test Results

test_update_compliance_report_draft_success (lcfs.tests.compliance_report.test_compliance_report_views) failed

backend/pytest-results.xml [took 0s]
Raw output
ValueError: Missing configuration: AUTH_URL, EMAIL_URL, CLIENT_ID, CLIENT_SECRET
client = <httpx.AsyncClient object at 0x7ff6aed353c0>
fastapi_app = <fastapi.applications.FastAPI object at 0x7ff6ae473b80>
compliance_report_base_schema = <function compliance_report_base_schema.<locals>._create_compliance_report_base_schema at 0x7ff6af088e50>
set_mock_user = <function set_mock_user.<locals>._set_mock_auth at 0x7ff6ae621870>

    @pytest.mark.anyio
    async def test_update_compliance_report_draft_success(
        client: AsyncClient,
        fastapi_app: FastAPI,
        compliance_report_base_schema,
        set_mock_user,
    ):
        with patch(
            "lcfs.web.api.compliance_report.views.ComplianceReportUpdateService.update_compliance_report"
        ) as mock_update_compliance_report, patch(
            "lcfs.web.api.compliance_report.views.ComplianceReportValidation.validate_organization_access"
        ) as mock_validate_organization_access:
            set_mock_user(fastapi_app, [RoleEnum.GOVERNMENT])
    
            mock_compliance_report = compliance_report_base_schema()
            mock_validate_organization_access.return_value = None
            mock_update_compliance_report.return_value = mock_compliance_report
    
            url = fastapi_app.url_path_for(
                "update_compliance_report",
                report_id=1,
            )
    
            payload = {"status": "Draft", "supplementalNote": "Drafting a new report"}
    
>           response = await client.put(url, json=payload)

lcfs/tests/compliance_report/test_compliance_report_views.py:624: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1885: in put
    return await self.request(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1533: in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1620: in send
    response = await self._send_handling_auth(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1648: in _send_handling_auth
    response = await self._send_handling_redirects(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1685: in _send_handling_redirects
    response = await self._send_single_request(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1722: in _send_single_request
    response = await transport.handle_async_request(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_transports/asgi.py:162: in handle_async_request
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/applications.py:1054: in __call__
    await super().__call__(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/applications.py:113: in __call__
    await self.middleware_stack(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/errors.py:187: in __call__
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/errors.py:165: in __call__
    await self.app(scope, receive, _send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/authentication.py:48: in __call__
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/cors.py:85: in __call__
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/exceptions.py:62: in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:715: in __call__
    await self.middleware_stack(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:735: in app
    await route.handle(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:288: in handle
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:76: in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:73: in app
    response = await f(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/routing.py:291: in app
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:615: in solve_dependencies
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:615: in solve_dependencies
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:640: in solve_dependencies
    solved = await run_in_threadpool(call, **solved_result.values)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/concurrency.py:39: in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/to_thread.py:33: in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py:877: in run_sync_in_worker_thread
    return await future
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py:807: in run
    result = context.run(func, *args)
lcfs/web/api/email/services.py:38: in __init__
    self._validate_configuration()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <lcfs.web.api.email.services.CHESEmailService object at 0x7ff6afcd64a0>

    def _validate_configuration(self):
        """
        Validate the CHES configuration to ensure all necessary environment variables are set.
        """
        missing = [key for key, value in self.config.items() if not value]
        if missing:
>           raise ValueError(f"Missing configuration: {', '.join(missing)}")
E           ValueError: Missing configuration: AUTH_URL, EMAIL_URL, CLIENT_ID, CLIENT_SECRET

lcfs/web/api/email/services.py:53: ValueError

Check warning on line 0 in lcfs.tests.compliance_report.test_compliance_report_views

See this annotation in the file changed.

@github-actions github-actions / Backend Test Results

test_update_compliance_report_submitted_success (lcfs.tests.compliance_report.test_compliance_report_views) failed

backend/pytest-results.xml [took 0s]
Raw output
ValueError: Missing configuration: AUTH_URL, EMAIL_URL, CLIENT_ID, CLIENT_SECRET
client = <httpx.AsyncClient object at 0x7ff6aed95030>
fastapi_app = <fastapi.applications.FastAPI object at 0x7ff6aed35810>
compliance_report_base_schema = <function compliance_report_base_schema.<locals>._create_compliance_report_base_schema at 0x7ff6aede9d80>
set_mock_user = <function set_mock_user.<locals>._set_mock_auth at 0x7ff6af089fc0>

    @pytest.mark.anyio
    async def test_update_compliance_report_submitted_success(
        client: AsyncClient,
        fastapi_app: FastAPI,
        compliance_report_base_schema,
        set_mock_user,
    ):
        with patch(
            "lcfs.web.api.compliance_report.views.ComplianceReportUpdateService.update_compliance_report"
        ) as mock_update_compliance_report, patch(
            "lcfs.web.api.compliance_report.views.ComplianceReportValidation.validate_organization_access"
        ) as mock_validate_organization_access:
            set_mock_user(fastapi_app, [RoleEnum.GOVERNMENT])
    
            mock_compliance_report = compliance_report_base_schema()
            mock_validate_organization_access.return_value = None
            mock_update_compliance_report.return_value = mock_compliance_report
    
            url = fastapi_app.url_path_for(
                "update_compliance_report",
                report_id=1,
            )
    
            payload = {"status": "Submitted", "supplementalNote": "Submitting the report"}
    
>           response = await client.put(url, json=payload)

lcfs/tests/compliance_report/test_compliance_report_views.py:662: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1885: in put
    return await self.request(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1533: in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1620: in send
    response = await self._send_handling_auth(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1648: in _send_handling_auth
    response = await self._send_handling_redirects(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1685: in _send_handling_redirects
    response = await self._send_single_request(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1722: in _send_single_request
    response = await transport.handle_async_request(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_transports/asgi.py:162: in handle_async_request
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/applications.py:1054: in __call__
    await super().__call__(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/applications.py:113: in __call__
    await self.middleware_stack(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/errors.py:187: in __call__
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/errors.py:165: in __call__
    await self.app(scope, receive, _send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/authentication.py:48: in __call__
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/cors.py:85: in __call__
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/exceptions.py:62: in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:715: in __call__
    await self.middleware_stack(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:735: in app
    await route.handle(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:288: in handle
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:76: in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:73: in app
    response = await f(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/routing.py:291: in app
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:615: in solve_dependencies
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:615: in solve_dependencies
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:640: in solve_dependencies
    solved = await run_in_threadpool(call, **solved_result.values)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/concurrency.py:39: in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/to_thread.py:33: in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py:877: in run_sync_in_worker_thread
    return await future
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py:807: in run
    result = context.run(func, *args)
lcfs/web/api/email/services.py:38: in __init__
    self._validate_configuration()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <lcfs.web.api.email.services.CHESEmailService object at 0x7ff6ae5ea6e0>

    def _validate_configuration(self):
        """
        Validate the CHES configuration to ensure all necessary environment variables are set.
        """
        missing = [key for key, value in self.config.items() if not value]
        if missing:
>           raise ValueError(f"Missing configuration: {', '.join(missing)}")
E           ValueError: Missing configuration: AUTH_URL, EMAIL_URL, CLIENT_ID, CLIENT_SECRET

lcfs/web/api/email/services.py:53: ValueError

Check warning on line 0 in lcfs.tests.compliance_report.test_compliance_report_views

See this annotation in the file changed.

@github-actions github-actions / Backend Test Results

test_update_compliance_report_recommended_by_analyst_success (lcfs.tests.compliance_report.test_compliance_report_views) failed

backend/pytest-results.xml [took 0s]
Raw output
ValueError: Missing configuration: AUTH_URL, EMAIL_URL, CLIENT_ID, CLIENT_SECRET
client = <httpx.AsyncClient object at 0x7ff6ae562e90>
fastapi_app = <fastapi.applications.FastAPI object at 0x7ff6aed953f0>
compliance_report_base_schema = <function compliance_report_base_schema.<locals>._create_compliance_report_base_schema at 0x7ff6aed1a290>
set_mock_user = <function set_mock_user.<locals>._set_mock_auth at 0x7ff6aedea290>

    @pytest.mark.anyio
    async def test_update_compliance_report_recommended_by_analyst_success(
        client: AsyncClient,
        fastapi_app: FastAPI,
        compliance_report_base_schema,
        set_mock_user,
    ):
        with patch(
            "lcfs.web.api.compliance_report.views.ComplianceReportUpdateService.update_compliance_report"
        ) as mock_update_compliance_report, patch(
            "lcfs.web.api.compliance_report.views.ComplianceReportValidation.validate_organization_access"
        ) as mock_validate_organization_access:
            set_mock_user(fastapi_app, [RoleEnum.GOVERNMENT])
    
            mock_compliance_report = compliance_report_base_schema()
            mock_validate_organization_access.return_value = None
            mock_update_compliance_report.return_value = mock_compliance_report
    
            url = fastapi_app.url_path_for(
                "update_compliance_report",
                report_id=1,
            )
    
            payload = {
                "status": "Recommended by analyst",
                "supplementalNote": "Analyst recommendation",
            }
    
>           response = await client.put(url, json=payload)

lcfs/tests/compliance_report/test_compliance_report_views.py:703: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1885: in put
    return await self.request(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1533: in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1620: in send
    response = await self._send_handling_auth(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1648: in _send_handling_auth
    response = await self._send_handling_redirects(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1685: in _send_handling_redirects
    response = await self._send_single_request(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1722: in _send_single_request
    response = await transport.handle_async_request(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_transports/asgi.py:162: in handle_async_request
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/applications.py:1054: in __call__
    await super().__call__(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/applications.py:113: in __call__
    await self.middleware_stack(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/errors.py:187: in __call__
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/errors.py:165: in __call__
    await self.app(scope, receive, _send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/authentication.py:48: in __call__
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/cors.py:85: in __call__
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/exceptions.py:62: in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:715: in __call__
    await self.middleware_stack(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:735: in app
    await route.handle(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:288: in handle
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:76: in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:73: in app
    response = await f(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/routing.py:291: in app
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:615: in solve_dependencies
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:615: in solve_dependencies
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:640: in solve_dependencies
    solved = await run_in_threadpool(call, **solved_result.values)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/concurrency.py:39: in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/to_thread.py:33: in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py:877: in run_sync_in_worker_thread
    return await future
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py:807: in run
    result = context.run(func, *args)
lcfs/web/api/email/services.py:38: in __init__
    self._validate_configuration()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <lcfs.web.api.email.services.CHESEmailService object at 0x7ff6ae5531f0>

    def _validate_configuration(self):
        """
        Validate the CHES configuration to ensure all necessary environment variables are set.
        """
        missing = [key for key, value in self.config.items() if not value]
        if missing:
>           raise ValueError(f"Missing configuration: {', '.join(missing)}")
E           ValueError: Missing configuration: AUTH_URL, EMAIL_URL, CLIENT_ID, CLIENT_SECRET

lcfs/web/api/email/services.py:53: ValueError

Check warning on line 0 in lcfs.tests.compliance_report.test_compliance_report_views

See this annotation in the file changed.

@github-actions github-actions / Backend Test Results

test_update_compliance_report_recommended_by_manager_success (lcfs.tests.compliance_report.test_compliance_report_views) failed

backend/pytest-results.xml [took 0s]
Raw output
ValueError: Missing configuration: AUTH_URL, EMAIL_URL, CLIENT_ID, CLIENT_SECRET
client = <httpx.AsyncClient object at 0x7ff6aed97e50>
fastapi_app = <fastapi.applications.FastAPI object at 0x7ff6aed961d0>
compliance_report_base_schema = <function compliance_report_base_schema.<locals>._create_compliance_report_base_schema at 0x7ff6af088670>
set_mock_user = <function set_mock_user.<locals>._set_mock_auth at 0x7ff6ae995a20>

    @pytest.mark.anyio
    async def test_update_compliance_report_recommended_by_manager_success(
        client: AsyncClient,
        fastapi_app: FastAPI,
        compliance_report_base_schema,
        set_mock_user,
    ):
        with patch(
            "lcfs.web.api.compliance_report.views.ComplianceReportUpdateService.update_compliance_report"
        ) as mock_update_compliance_report, patch(
            "lcfs.web.api.compliance_report.views.ComplianceReportValidation.validate_organization_access"
        ) as mock_validate_organization_access:
            set_mock_user(fastapi_app, [RoleEnum.GOVERNMENT])
    
            mock_compliance_report = compliance_report_base_schema()
            mock_validate_organization_access.return_value = None
            mock_update_compliance_report.return_value = mock_compliance_report
    
            url = fastapi_app.url_path_for(
                "update_compliance_report",
                report_id=1,
            )
    
            payload = {
                "status": "Recommended by manager",
                "supplementalNote": "Manager recommendation",
            }
    
>           response = await client.put(url, json=payload)

lcfs/tests/compliance_report/test_compliance_report_views.py:744: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1885: in put
    return await self.request(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1533: in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1620: in send
    response = await self._send_handling_auth(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1648: in _send_handling_auth
    response = await self._send_handling_redirects(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1685: in _send_handling_redirects
    response = await self._send_single_request(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1722: in _send_single_request
    response = await transport.handle_async_request(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_transports/asgi.py:162: in handle_async_request
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/applications.py:1054: in __call__
    await super().__call__(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/applications.py:113: in __call__
    await self.middleware_stack(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/errors.py:187: in __call__
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/errors.py:165: in __call__
    await self.app(scope, receive, _send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/authentication.py:48: in __call__
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/cors.py:85: in __call__
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/exceptions.py:62: in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:715: in __call__
    await self.middleware_stack(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:735: in app
    await route.handle(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:288: in handle
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:76: in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:73: in app
    response = await f(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/routing.py:291: in app
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:615: in solve_dependencies
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:615: in solve_dependencies
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:640: in solve_dependencies
    solved = await run_in_threadpool(call, **solved_result.values)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/concurrency.py:39: in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/to_thread.py:33: in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py:877: in run_sync_in_worker_thread
    return await future
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py:807: in run
    result = context.run(func, *args)
lcfs/web/api/email/services.py:38: in __init__
    self._validate_configuration()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <lcfs.web.api.email.services.CHESEmailService object at 0x7ff6afd35690>

    def _validate_configuration(self):
        """
        Validate the CHES configuration to ensure all necessary environment variables are set.
        """
        missing = [key for key, value in self.config.items() if not value]
        if missing:
>           raise ValueError(f"Missing configuration: {', '.join(missing)}")
E           ValueError: Missing configuration: AUTH_URL, EMAIL_URL, CLIENT_ID, CLIENT_SECRET

lcfs/web/api/email/services.py:53: ValueError

Check warning on line 0 in lcfs.tests.compliance_report.test_compliance_report_views

See this annotation in the file changed.

@github-actions github-actions / Backend Test Results

test_update_compliance_report_assessed_success (lcfs.tests.compliance_report.test_compliance_report_views) failed

backend/pytest-results.xml [took 0s]
Raw output
ValueError: Missing configuration: AUTH_URL, EMAIL_URL, CLIENT_ID, CLIENT_SECRET
client = <httpx.AsyncClient object at 0x7ff6ae3057b0>
fastapi_app = <fastapi.applications.FastAPI object at 0x7ff6aed970a0>
compliance_report_base_schema = <function compliance_report_base_schema.<locals>._create_compliance_report_base_schema at 0x7ff6ae994430>
set_mock_user = <function set_mock_user.<locals>._set_mock_auth at 0x7ff6af089cf0>

    @pytest.mark.anyio
    async def test_update_compliance_report_assessed_success(
        client: AsyncClient,
        fastapi_app: FastAPI,
        compliance_report_base_schema,
        set_mock_user,
    ):
        with patch(
            "lcfs.web.api.compliance_report.views.ComplianceReportUpdateService.update_compliance_report"
        ) as mock_update_compliance_report, patch(
            "lcfs.web.api.compliance_report.views.ComplianceReportValidation.validate_organization_access"
        ) as mock_validate_organization_access:
            set_mock_user(fastapi_app, [RoleEnum.GOVERNMENT])
    
            mock_compliance_report = compliance_report_base_schema()
            mock_validate_organization_access.return_value = None
            mock_update_compliance_report.return_value = mock_compliance_report
    
            url = fastapi_app.url_path_for(
                "update_compliance_report",
                report_id=1,
            )
    
            payload = {"status": "Assessed", "supplementalNote": "Report has been assessed"}
    
>           response = await client.put(url, json=payload)

lcfs/tests/compliance_report/test_compliance_report_views.py:782: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1885: in put
    return await self.request(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1533: in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1620: in send
    response = await self._send_handling_auth(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1648: in _send_handling_auth
    response = await self._send_handling_redirects(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1685: in _send_handling_redirects
    response = await self._send_single_request(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1722: in _send_single_request
    response = await transport.handle_async_request(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_transports/asgi.py:162: in handle_async_request
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/applications.py:1054: in __call__
    await super().__call__(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/applications.py:113: in __call__
    await self.middleware_stack(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/errors.py:187: in __call__
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/errors.py:165: in __call__
    await self.app(scope, receive, _send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/authentication.py:48: in __call__
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/cors.py:85: in __call__
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/exceptions.py:62: in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:715: in __call__
    await self.middleware_stack(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:735: in app
    await route.handle(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:288: in handle
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:76: in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:73: in app
    response = await f(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/routing.py:291: in app
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:615: in solve_dependencies
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:615: in solve_dependencies
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:640: in solve_dependencies
    solved = await run_in_threadpool(call, **solved_result.values)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/concurrency.py:39: in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/to_thread.py:33: in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py:877: in run_sync_in_worker_thread
    return await future
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py:807: in run
    result = context.run(func, *args)
lcfs/web/api/email/services.py:38: in __init__
    self._validate_configuration()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <lcfs.web.api.email.services.CHESEmailService object at 0x7ff6aed3db10>

    def _validate_configuration(self):
        """
        Validate the CHES configuration to ensure all necessary environment variables are set.
        """
        missing = [key for key, value in self.config.items() if not value]
        if missing:
>           raise ValueError(f"Missing configuration: {', '.join(missing)}")
E           ValueError: Missing configuration: AUTH_URL, EMAIL_URL, CLIENT_ID, CLIENT_SECRET

lcfs/web/api/email/services.py:53: ValueError

Check warning on line 0 in lcfs.tests.notification.test_notification_views

See this annotation in the file changed.

@github-actions github-actions / Backend Test Results

test_mark_notification_as_read (lcfs.tests.notification.test_notification_views) failed

backend/pytest-results.xml [took 0s]
Raw output
ValueError: Missing configuration: AUTH_URL, EMAIL_URL, CLIENT_ID, CLIENT_SECRET
client = <httpx.AsyncClient object at 0x7ff6ae5df4c0>
fastapi_app = <fastapi.applications.FastAPI object at 0x7ff6addc7160>
set_mock_user = <function set_mock_user.<locals>._set_mock_auth at 0x7ff6adf9f880>

    @pytest.mark.anyio
    async def test_mark_notification_as_read(client, fastapi_app, set_mock_user):
        with patch(
            "lcfs.web.api.notification.views.NotificationService.update_notification"
        ) as mock_update_notification:
            # Set the mock response data to include all required fields in camelCase
            mock_update_notification.return_value = {
                "notificationMessageId": 1,
                "isRead": True,
                "message": "Mark as read test",
                "originUserProfileId": 1,
                "relatedUserProfileId": 1,
                "notificationTypeId": 1,
            }
    
            set_mock_user(fastapi_app, [RoleEnum.GOVERNMENT])
    
            url = fastapi_app.url_path_for("save_notification")
    
            payload = {
                "notification_message_id": 1,
                "is_read": True,
                "message": "Mark as read test",
                "origin_user_profile_id": 1,
                "related_user_profile_id": 1,
                "notification_type_id": 1,
            }
    
>           response = await client.post(url, json=payload)

lcfs/tests/notification/test_notification_views.py:67: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1848: in post
    return await self.request(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1533: in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1620: in send
    response = await self._send_handling_auth(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1648: in _send_handling_auth
    response = await self._send_handling_redirects(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1685: in _send_handling_redirects
    response = await self._send_single_request(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1722: in _send_single_request
    response = await transport.handle_async_request(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_transports/asgi.py:162: in handle_async_request
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/applications.py:1054: in __call__
    await super().__call__(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/applications.py:113: in __call__
    await self.middleware_stack(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/errors.py:187: in __call__
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/errors.py:165: in __call__
    await self.app(scope, receive, _send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/authentication.py:48: in __call__
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/cors.py:85: in __call__
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/exceptions.py:62: in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:715: in __call__
    await self.middleware_stack(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:735: in app
    await route.handle(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:288: in handle
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:76: in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:73: in app
    response = await f(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/routing.py:291: in app
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:615: in solve_dependencies
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:640: in solve_dependencies
    solved = await run_in_threadpool(call, **solved_result.values)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/concurrency.py:39: in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/to_thread.py:33: in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py:877: in run_sync_in_worker_thread
    return await future
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py:807: in run
    result = context.run(func, *args)
lcfs/web/api/email/services.py:38: in __init__
    self._validate_configuration()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <lcfs.web.api.email.services.CHESEmailService object at 0x7ff6aee6d660>

    def _validate_configuration(self):
        """
        Validate the CHES configuration to ensure all necessary environment variables are set.
        """
        missing = [key for key, value in self.config.items() if not value]
        if missing:
>           raise ValueError(f"Missing configuration: {', '.join(missing)}")
E           ValueError: Missing configuration: AUTH_URL, EMAIL_URL, CLIENT_ID, CLIENT_SECRET

lcfs/web/api/email/services.py:53: ValueError

Check warning on line 0 in lcfs.tests.notification.test_notification_views

See this annotation in the file changed.

@github-actions github-actions / Backend Test Results

test_create_notification (lcfs.tests.notification.test_notification_views) failed

backend/pytest-results.xml [took 0s]
Raw output
ValueError: Missing configuration: AUTH_URL, EMAIL_URL, CLIENT_ID, CLIENT_SECRET
client = <httpx.AsyncClient object at 0x7ff6ae535bd0>
fastapi_app = <fastapi.applications.FastAPI object at 0x7ff6ae5dedd0>
set_mock_user = <function set_mock_user.<locals>._set_mock_auth at 0x7ff6af97ce50>

    @pytest.mark.anyio
    async def test_create_notification(client, fastapi_app, set_mock_user):
        with patch(
            "lcfs.web.api.notification.views.NotificationService.create_notification_message"
        ) as mock_create_notification:
            notification_data = {
                "message": "New notification",
                "notification_type_id": 1,
                "related_user_profile_id": 1,
                "related_organization_id": 1,
            }
    
            mock_create_notification.return_value = notification_data
    
            set_mock_user(fastapi_app, [RoleEnum.GOVERNMENT])
    
            url = fastapi_app.url_path_for("save_notification")
    
>           response = await client.post(url, json=notification_data)

lcfs/tests/notification/test_notification_views.py:102: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1848: in post
    return await self.request(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1533: in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1620: in send
    response = await self._send_handling_auth(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1648: in _send_handling_auth
    response = await self._send_handling_redirects(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1685: in _send_handling_redirects
    response = await self._send_single_request(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1722: in _send_single_request
    response = await transport.handle_async_request(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_transports/asgi.py:162: in handle_async_request
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/applications.py:1054: in __call__
    await super().__call__(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/applications.py:113: in __call__
    await self.middleware_stack(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/errors.py:187: in __call__
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/errors.py:165: in __call__
    await self.app(scope, receive, _send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/authentication.py:48: in __call__
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/cors.py:85: in __call__
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/exceptions.py:62: in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:715: in __call__
    await self.middleware_stack(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:735: in app
    await route.handle(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:288: in handle
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:76: in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:73: in app
    response = await f(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/routing.py:291: in app
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:615: in solve_dependencies
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:640: in solve_dependencies
    solved = await run_in_threadpool(call, **solved_result.values)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/concurrency.py:39: in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/to_thread.py:33: in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py:877: in run_sync_in_worker_thread
    return await future
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py:807: in run
    result = context.run(func, *args)
lcfs/web/api/email/services.py:38: in __init__
    self._validate_configuration()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <lcfs.web.api.email.services.CHESEmailService object at 0x7ff6ae399bd0>

    def _validate_configuration(self):
        """
        Validate the CHES configuration to ensure all necessary environment variables are set.
        """
        missing = [key for key, value in self.config.items() if not value]
        if missing:
>           raise ValueError(f"Missing configuration: {', '.join(missing)}")
E           ValueError: Missing configuration: AUTH_URL, EMAIL_URL, CLIENT_ID, CLIENT_SECRET

lcfs/web/api/email/services.py:53: ValueError

Check warning on line 0 in lcfs.tests.notification.test_notification_views

See this annotation in the file changed.

@github-actions github-actions / Backend Test Results

test_delete_notification (lcfs.tests.notification.test_notification_views) failed

backend/pytest-results.xml [took 0s]
Raw output
ValueError: Missing configuration: AUTH_URL, EMAIL_URL, CLIENT_ID, CLIENT_SECRET
client = <httpx.AsyncClient object at 0x7ff6af8f4520>
fastapi_app = <fastapi.applications.FastAPI object at 0x7ff6ae535a50>
set_mock_user = <function set_mock_user.<locals>._set_mock_auth at 0x7ff6afcabd90>

    @pytest.mark.anyio
    async def test_delete_notification(client, fastapi_app, set_mock_user):
        with patch(
            "lcfs.web.api.notification.views.NotificationService.delete_notification_message",
            return_value=None,
        ) as mock_delete_notification:
            set_mock_user(fastapi_app, [RoleEnum.GOVERNMENT])
    
            mock_delete_notification.return_value = {
                "message": "Notification Message deleted successfully"
            }
    
            url = fastapi_app.url_path_for("save_notification")  # No notification_id here
    
>           response = await client.post(
                url, json={"notification_message_id": 1, "deleted": True}
            )

lcfs/tests/notification/test_notification_views.py:123: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1848: in post
    return await self.request(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1533: in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1620: in send
    response = await self._send_handling_auth(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1648: in _send_handling_auth
    response = await self._send_handling_redirects(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1685: in _send_handling_redirects
    response = await self._send_single_request(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1722: in _send_single_request
    response = await transport.handle_async_request(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_transports/asgi.py:162: in handle_async_request
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/applications.py:1054: in __call__
    await super().__call__(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/applications.py:113: in __call__
    await self.middleware_stack(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/errors.py:187: in __call__
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/errors.py:165: in __call__
    await self.app(scope, receive, _send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/authentication.py:48: in __call__
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/cors.py:85: in __call__
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/exceptions.py:62: in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:715: in __call__
    await self.middleware_stack(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:735: in app
    await route.handle(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:288: in handle
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:76: in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:73: in app
    response = await f(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/routing.py:291: in app
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:615: in solve_dependencies
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:640: in solve_dependencies
    solved = await run_in_threadpool(call, **solved_result.values)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/concurrency.py:39: in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/to_thread.py:33: in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py:877: in run_sync_in_worker_thread
    return await future
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py:807: in run
    result = context.run(func, *args)
lcfs/web/api/email/services.py:38: in __init__
    self._validate_configuration()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <lcfs.web.api.email.services.CHESEmailService object at 0x7ff6af94e050>

    def _validate_configuration(self):
        """
        Validate the CHES configuration to ensure all necessary environment variables are set.
        """
        missing = [key for key, value in self.config.items() if not value]
        if missing:
>           raise ValueError(f"Missing configuration: {', '.join(missing)}")
E           ValueError: Missing configuration: AUTH_URL, EMAIL_URL, CLIENT_ID, CLIENT_SECRET

lcfs/web/api/email/services.py:53: ValueError

Check warning on line 0 in lcfs.tests.notification.test_notification_views

See this annotation in the file changed.

@github-actions github-actions / Backend Test Results

test_get_notifications_by_id (lcfs.tests.notification.test_notification_views) failed

backend/pytest-results.xml [took 0s]
Raw output
ValueError: Missing configuration: AUTH_URL, EMAIL_URL, CLIENT_ID, CLIENT_SECRET
client = <httpx.AsyncClient object at 0x7ff6ae9e87c0>
fastapi_app = <fastapi.applications.FastAPI object at 0x7ff6af85a1a0>
set_mock_user = <function set_mock_user.<locals>._set_mock_auth at 0x7ff6ad7597e0>

    @pytest.mark.anyio
    async def test_get_notifications_by_id(
        client: AsyncClient,
        fastapi_app: FastAPI,
        set_mock_user,
    ):
        with patch(
            "lcfs.web.api.notification.views.NotificationService.get_notification_message_by_id"
        ) as mock_get_notifications:
            mock_notification_data = mock_notification.model_copy()
            mock_notification_data.related_user_profile_id = 1
            mock_get_notifications.return_value = mock_notification_data
    
            set_mock_user(
                fastapi_app,
                [RoleEnum.GOVERNMENT],
                user_details={"user_profile_id": 1},
            )
    
            url = fastapi_app.url_path_for(
                "get_notification_message_by_id", notification_id=1
            )
            print("Resolved URL:", url)
    
>           response = await client.get(url)

lcfs/tests/notification/test_notification_views.py:156: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1757: in get
    return await self.request(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1533: in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1620: in send
    response = await self._send_handling_auth(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1648: in _send_handling_auth
    response = await self._send_handling_redirects(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1685: in _send_handling_redirects
    response = await self._send_single_request(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1722: in _send_single_request
    response = await transport.handle_async_request(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_transports/asgi.py:162: in handle_async_request
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/applications.py:1054: in __call__
    await super().__call__(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/applications.py:113: in __call__
    await self.middleware_stack(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/errors.py:187: in __call__
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/errors.py:165: in __call__
    await self.app(scope, receive, _send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/authentication.py:48: in __call__
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/cors.py:85: in __call__
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/exceptions.py:62: in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:715: in __call__
    await self.middleware_stack(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:735: in app
    await route.handle(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:288: in handle
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:76: in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:73: in app
    response = await f(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/routing.py:291: in app
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:615: in solve_dependencies
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:640: in solve_dependencies
    solved = await run_in_threadpool(call, **solved_result.values)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/concurrency.py:39: in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/to_thread.py:33: in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py:877: in run_sync_in_worker_thread
    return await future
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py:807: in run
    result = context.run(func, *args)
lcfs/web/api/email/services.py:38: in __init__
    self._validate_configuration()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <lcfs.web.api.email.services.CHESEmailService object at 0x7ff6afabb1f0>

    def _validate_configuration(self):
        """
        Validate the CHES configuration to ensure all necessary environment variables are set.
        """
        missing = [key for key, value in self.config.items() if not value]
        if missing:
>           raise ValueError(f"Missing configuration: {', '.join(missing)}")
E           ValueError: Missing configuration: AUTH_URL, EMAIL_URL, CLIENT_ID, CLIENT_SECRET

lcfs/web/api/email/services.py:53: ValueError

Check warning on line 0 in lcfs.tests.notification.test_notification_views

See this annotation in the file changed.

@github-actions github-actions / Backend Test Results

test_get_notification_channel_subscription_by_id (lcfs.tests.notification.test_notification_views) failed

backend/pytest-results.xml [took 0s]
Raw output
ValueError: Missing configuration: AUTH_URL, EMAIL_URL, CLIENT_ID, CLIENT_SECRET
client = <httpx.AsyncClient object at 0x7ff6ade99b70>
fastapi_app = <fastapi.applications.FastAPI object at 0x7ff6ade994b0>
set_mock_user = <function set_mock_user.<locals>._set_mock_auth at 0x7ff6ad32aef0>

    @pytest.mark.anyio
    async def test_get_notification_channel_subscription_by_id(
        client: AsyncClient,
        fastapi_app: FastAPI,
        set_mock_user,
    ):
        with patch(
            "lcfs.web.api.notification.views.NotificationService.get_notification_channel_subscription_by_id"
        ) as mock_get_subscription:
            mock_subscription = SubscriptionSchema(
                notification_channel_subscription_id=1,
                user_profile_id=1,  # Match mock user
                notification_channel_name="EMAIL",
                notification_type_name="BCEID__COMPLIANCE_REPORT__DIRECTOR_ASSESSMENT",
                is_enabled=True,
            )
            mock_get_subscription.return_value = mock_subscription
    
            set_mock_user(
                fastapi_app,
                [RoleEnum.GOVERNMENT],
                user_details={"user_profile_id": 1},
            )
    
            url = fastapi_app.url_path_for(
                "get_notification_channel_subscription_by_id",
                notification_channel_subscription_id=1,
            )
    
>           response = await client.get(url)

lcfs/tests/notification/test_notification_views.py:192: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1757: in get
    return await self.request(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1533: in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1620: in send
    response = await self._send_handling_auth(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1648: in _send_handling_auth
    response = await self._send_handling_redirects(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1685: in _send_handling_redirects
    response = await self._send_single_request(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1722: in _send_single_request
    response = await transport.handle_async_request(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_transports/asgi.py:162: in handle_async_request
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/applications.py:1054: in __call__
    await super().__call__(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/applications.py:113: in __call__
    await self.middleware_stack(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/errors.py:187: in __call__
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/errors.py:165: in __call__
    await self.app(scope, receive, _send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/authentication.py:48: in __call__
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/cors.py:85: in __call__
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/exceptions.py:62: in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:715: in __call__
    await self.middleware_stack(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:735: in app
    await route.handle(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:288: in handle
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:76: in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:73: in app
    response = await f(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/routing.py:291: in app
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:615: in solve_dependencies
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:640: in solve_dependencies
    solved = await run_in_threadpool(call, **solved_result.values)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/concurrency.py:39: in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/to_thread.py:33: in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py:877: in run_sync_in_worker_thread
    return await future
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py:807: in run
    result = context.run(func, *args)
lcfs/web/api/email/services.py:38: in __init__
    self._validate_configuration()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <lcfs.web.api.email.services.CHESEmailService object at 0x7ff6ae455540>

    def _validate_configuration(self):
        """
        Validate the CHES configuration to ensure all necessary environment variables are set.
        """
        missing = [key for key, value in self.config.items() if not value]
        if missing:
>           raise ValueError(f"Missing configuration: {', '.join(missing)}")
E           ValueError: Missing configuration: AUTH_URL, EMAIL_URL, CLIENT_ID, CLIENT_SECRET

lcfs/web/api/email/services.py:53: ValueError

Check warning on line 0 in lcfs.tests.notification.test_notification_views

See this annotation in the file changed.

@github-actions github-actions / Backend Test Results

test_create_subscription (lcfs.tests.notification.test_notification_views) failed

backend/pytest-results.xml [took 0s]
Raw output
ValueError: Missing configuration: AUTH_URL, EMAIL_URL, CLIENT_ID, CLIENT_SECRET
client = <httpx.AsyncClient object at 0x7ff6afa04400>
fastapi_app = <fastapi.applications.FastAPI object at 0x7ff6ade98340>
set_mock_user = <function set_mock_user.<locals>._set_mock_auth at 0x7ff6afca9090>

    @pytest.mark.anyio
    async def test_create_subscription(client, fastapi_app, set_mock_user):
        with patch(
            "lcfs.web.api.notification.views.NotificationService.create_notification_channel_subscription"
        ) as mock_create_subscription:
            subscription_data = {
                "is_enabled": True,
                "notification_channel_id": 1,
                "user_profile_id": 1,
                "notification_type_id": 1,
            }
    
            mock_create_subscription.return_value = subscription_data
    
            set_mock_user(fastapi_app, [RoleEnum.GOVERNMENT])
    
            url = fastapi_app.url_path_for("save_subscription")
    
>           response = await client.post(url, json=subscription_data)

lcfs/tests/notification/test_notification_views.py:219: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1848: in post
    return await self.request(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1533: in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1620: in send
    response = await self._send_handling_auth(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1648: in _send_handling_auth
    response = await self._send_handling_redirects(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1685: in _send_handling_redirects
    response = await self._send_single_request(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1722: in _send_single_request
    response = await transport.handle_async_request(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_transports/asgi.py:162: in handle_async_request
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/applications.py:1054: in __call__
    await super().__call__(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/applications.py:113: in __call__
    await self.middleware_stack(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/errors.py:187: in __call__
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/errors.py:165: in __call__
    await self.app(scope, receive, _send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/authentication.py:48: in __call__
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/cors.py:85: in __call__
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/exceptions.py:62: in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:715: in __call__
    await self.middleware_stack(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:735: in app
    await route.handle(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:288: in handle
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:76: in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:73: in app
    response = await f(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/routing.py:291: in app
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:615: in solve_dependencies
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:640: in solve_dependencies
    solved = await run_in_threadpool(call, **solved_result.values)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/concurrency.py:39: in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/to_thread.py:33: in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py:877: in run_sync_in_worker_thread
    return await future
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py:807: in run
    result = context.run(func, *args)
lcfs/web/api/email/services.py:38: in __init__
    self._validate_configuration()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <lcfs.web.api.email.services.CHESEmailService object at 0x7ff6aef7a140>

    def _validate_configuration(self):
        """
        Validate the CHES configuration to ensure all necessary environment variables are set.
        """
        missing = [key for key, value in self.config.items() if not value]
        if missing:
>           raise ValueError(f"Missing configuration: {', '.join(missing)}")
E           ValueError: Missing configuration: AUTH_URL, EMAIL_URL, CLIENT_ID, CLIENT_SECRET

lcfs/web/api/email/services.py:53: ValueError

Check warning on line 0 in lcfs.tests.notification.test_notification_views

See this annotation in the file changed.

@github-actions github-actions / Backend Test Results

test_delete_subscription (lcfs.tests.notification.test_notification_views) failed

backend/pytest-results.xml [took 0s]
Raw output
ValueError: Missing configuration: AUTH_URL, EMAIL_URL, CLIENT_ID, CLIENT_SECRET
client = <httpx.AsyncClient object at 0x7ff6af1d0a60>
fastapi_app = <fastapi.applications.FastAPI object at 0x7ff6af7fdf30>
set_mock_user = <function set_mock_user.<locals>._set_mock_auth at 0x7ff6ae08ca60>

    @pytest.mark.anyio
    async def test_delete_subscription(client, fastapi_app, set_mock_user):
        with patch(
            "lcfs.web.api.notification.views.NotificationService.delete_notification_channel_subscription",
            return_value=None,
        ) as mock_delete_subscription:
            set_mock_user(
                fastapi_app,
                [RoleEnum.GOVERNMENT],
                user_details={"user_profile_id": 1},
            )
    
            url = fastapi_app.url_path_for("save_subscription")
    
            subscription_data = {
                "notification_channel_subscription_id": 1,
                "deleted": True,
            }
    
>           response = await client.post(url, json=subscription_data)

lcfs/tests/notification/test_notification_views.py:246: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1848: in post
    return await self.request(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1533: in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1620: in send
    response = await self._send_handling_auth(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1648: in _send_handling_auth
    response = await self._send_handling_redirects(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1685: in _send_handling_redirects
    response = await self._send_single_request(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_client.py:1722: in _send_single_request
    response = await transport.handle_async_request(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/httpx/_transports/asgi.py:162: in handle_async_request
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/applications.py:1054: in __call__
    await super().__call__(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/applications.py:113: in __call__
    await self.middleware_stack(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/errors.py:187: in __call__
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/errors.py:165: in __call__
    await self.app(scope, receive, _send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/authentication.py:48: in __call__
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/cors.py:85: in __call__
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/middleware/exceptions.py:62: in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:715: in __call__
    await self.middleware_stack(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:735: in app
    await route.handle(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:288: in handle
    await self.app(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:76: in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:53: in wrapped_app
    raise exc
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/_exception_handler.py:42: in wrapped_app
    await app(scope, receive, sender)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/routing.py:73: in app
    response = await f(request)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/routing.py:291: in app
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:615: in solve_dependencies
    solved_result = await solve_dependencies(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/fastapi/dependencies/utils.py:640: in solve_dependencies
    solved = await run_in_threadpool(call, **solved_result.values)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/starlette/concurrency.py:39: in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/to_thread.py:33: in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py:877: in run_sync_in_worker_thread
    return await future
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py:807: in run
    result = context.run(func, *args)
lcfs/web/api/email/services.py:38: in __init__
    self._validate_configuration()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <lcfs.web.api.email.services.CHESEmailService object at 0x7ff6af126ef0>

    def _validate_configuration(self):
        """
        Validate the CHES configuration to ensure all necessary environment variables are set.
        """
        missing = [key for key, value in self.config.items() if not value]
        if missing:
>           raise ValueError(f"Missing configuration: {', '.join(missing)}")
E           ValueError: Missing configuration: AUTH_URL, EMAIL_URL, CLIENT_ID, CLIENT_SECRET

lcfs/web/api/email/services.py:53: ValueError