<s> from django . test import TestCase <EOL> from rapidsms . models import Backend <EOL> from rapidsms . backends . base import BackendBase <EOL> class TestBackend ( BackendBase ) : <EOL> pass <EOL> class BackendBaseTest ( TestCase ) : <EOL> def test_backend_has_name ( self ) : <EOL> backend = BackendBase ( None , "<STR_LIT>" ) <EOL> self . assertEqual ( repr ( backend ) , "<STR_LIT>" ) <EOL> self . assertEqual ( str ( backend ) , "<STR_LIT>" ) <EOL> self . assertEqual ( backend . name , "<STR_LIT>" ) <EOL> def test_backend_has_model ( self ) : <EOL> backend = BackendBase ( None , "<STR_LIT>" ) <EOL> self . assertEqual ( backend . model . __class__ , Backend ) <EOL> self . assertEqual ( backend . model . name , "<STR_LIT>" ) <EOL> self . assertEqual ( Backend . objects . filter ( name = "<STR_LIT>" ) . count ( ) , <NUM_LIT:1> ) <EOL> def test_backend_passes_kwargs_to_configure ( self ) : <EOL> class ConfigurableBackend ( BackendBase ) : <EOL> def configure ( self , ** kwargs ) : <EOL> self . conf = kwargs <EOL> conf_backend = ConfigurableBackend ( None , "<STR_LIT>" , a = <NUM_LIT:1> , b = <NUM_LIT:2> ) <EOL> self . assertEqual ( conf_backend . conf , { "<STR_LIT:a>" : <NUM_LIT:1> , "<STR_LIT:b>" : <NUM_LIT:2> } ) <EOL> def test_backend_finds_valid_backend_class ( self ) : <EOL> """<STR_LIT>""" <EOL> backend = BackendBase . find ( '<STR_LIT>' ) <EOL> self . assertEqual ( TestBackend , backend ) </s>
