<s> from django . conf import settings <EOL> from django . test import TestCase , override_settings <EOL> from django_slack import slack_message <EOL> from django_slack . utils import get_backend <EOL> from django_slack . app_settings import app_settings <EOL> from tests . backends import RaisingBackend <EOL> class TestOverride ( TestCase ) : <EOL> def setUp ( self ) : <EOL> get_backend . backend = None <EOL> def test_override ( self ) : <EOL> """<STR_LIT>""" <EOL> DISABLED_BACKEND = '<STR_LIT>' <EOL> with override_settings ( SLACK_BACKEND = DISABLED_BACKEND ) : <EOL> self . assertEqual ( settings . SLACK_BACKEND , DISABLED_BACKEND ) <EOL> self . assertEqual ( app_settings . BACKEND , DISABLED_BACKEND ) <EOL> def test_backend_cache ( self ) : <EOL> """<STR_LIT>""" <EOL> self . assertEqual ( id ( get_backend ( ) ) , id ( get_backend ( ) ) ) <EOL> def test_backend_override ( self ) : <EOL> """<STR_LIT>""" <EOL> with override_settings ( SLACK_BACKEND = '<STR_LIT>' ) : <EOL> with self . assertRaises ( RaisingBackend . RaisedException ) : <EOL> slack_message ( '<STR_LIT>' , { '<STR_LIT:text>' : '<STR_LIT:test>' } ) <EOL> def test_fail_silently ( self ) : <EOL> """<STR_LIT>""" <EOL> with override_settings ( <EOL> SLACK_FAIL_SILENTLY = True , <EOL> SLACK_BACKEND = '<STR_LIT>' , <EOL> ) : <EOL> slack_message ( '<STR_LIT>' , { '<STR_LIT:text>' : '<STR_LIT:test>' } ) </s>
