"""Tests for the WSGI configuration module."""importosfromdjango.core.wsgiimportget_wsgi_applicationfromtrustpoint.wsgiimportapplication
[docs]deftest_wsgi_application_initialization()->None:"""Test that the WSGI application is initialized correctly."""assertos.getenv('DJANGO_SETTINGS_MODULE')=='trustpoint.settings', \
"DJANGO_SETTINGS_MODULE should be 'trustpoint.settings'."assertcallable(application),'WSGI application should be callable.'try:wsgi_app=get_wsgi_application()assertcallable(wsgi_app),('Initializing the WSGI application with `get_wsgi_application` should produce a callable.')exceptExceptionase:error_message=f'WSGI application initialization failed. Error: {e}'raiseAssertionError(error_message)frome