# Path: modoboa_amavis/checks/settings_checks.py
# W001 = Warning(
#     _("AMAVIS_DEFAULT_DATABASE_ENCODING does not match the character "
#       "encoding used by the Amavis database."),
#     hint=_("Check your database character encoding and set/update "
#            "AMAVIS_DEFAULT_DATABASE_ENCODING."),
#     id="modoboa-amavis.W001",
# )
# W002 = Warning(
#     _("Modoboa Amavis has not been tested using the selected database engine."),
#     hint=_("Try using PostgreSQL, MySQL or MariaDB."),
#     id="modoboa-amavis.W002",
# )
# def check_amavis_database_encoding(app_configs, **kwargs):


from django.test import TestCase
from django.test.utils import override_settings
from ..checks import settings_checks
# -*- coding: utf-8 -*-




class CheckSessionCookieSecureTest(TestCase):

    databases = '__all__'

    @override_settings(AMAVIS_DEFAULT_DATABASE_ENCODING="LATIN-1")
    def test_amavis_database_encoding_incorrect(self):
        """
        If AMAVIS_DEFAULT_DATABASE_ENCODING is incorrect provide one warning.
        """
        self.assertEqual(
            settings_checks.check_amavis_database_encoding(None),

# Path: modoboa_amavis/checks/settings_checks.py
# W001 = Warning(
#     _("AMAVIS_DEFAULT_DATABASE_ENCODING does not match the character "
#       "encoding used by the Amavis database."),
#     hint=_("Check your database character encoding and set/update "
#            "AMAVIS_DEFAULT_DATABASE_ENCODING."),
#     id="modoboa-amavis.W001",
# )
# W002 = Warning(
#     _("Modoboa Amavis has not been tested using the selected database engine."),
#     hint=_("Try using PostgreSQL, MySQL or MariaDB."),
#     id="modoboa-amavis.W002",
# )
# def check_amavis_database_encoding(app_configs, **kwargs):


# Path: modoboa_amavis/tests/test_checks.py
from django.test import TestCase
from django.test.utils import override_settings
from ..checks import settings_checks

# -*- coding: utf-8 -*-




class CheckSessionCookieSecureTest(TestCase):

    databases = '__all__'

    @override_settings(AMAVIS_DEFAULT_DATABASE_ENCODING="LATIN-1")
    def test_amavis_database_encoding_incorrect(self):
        """
        If AMAVIS_DEFAULT_DATABASE_ENCODING is incorrect provide one warning.
        """
        self.assertEqual(
            settings_checks.check_amavis_database_encoding(None),

            [settings_checks.W001]