mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-07-06 20:54:01 +02:00
Cover also settings files, keep 100% coverage by ignoring production files
This commit is contained in:
24
corres2math/tests.py
Normal file
24
corres2math/tests.py
Normal file
@ -0,0 +1,24 @@
|
||||
import os
|
||||
|
||||
from django.core.handlers.asgi import ASGIHandler
|
||||
from django.core.handlers.wsgi import WSGIHandler
|
||||
from django.test import TestCase
|
||||
|
||||
|
||||
class TestLoadModules(TestCase):
|
||||
"""
|
||||
Load modules that are not used in development mode in order to increase coverage.
|
||||
"""
|
||||
def test_asgi(self):
|
||||
from corres2math import asgi
|
||||
self.assertTrue(isinstance(asgi.application, ASGIHandler))
|
||||
|
||||
def test_wsgi(self):
|
||||
from corres2math import wsgi
|
||||
self.assertTrue(isinstance(wsgi.application, WSGIHandler))
|
||||
|
||||
def test_load_production_settings(self):
|
||||
os.putenv("CORRES2MATH_STAGE", "prod")
|
||||
os.putenv("DJANGO_DB_TYPE", "postgres")
|
||||
from corres2math import settings_prod
|
||||
self.assertFalse(settings_prod.DEBUG)
|
Reference in New Issue
Block a user