<s> from __future__ import unicode_literals <EOL> from django . test import TestCase <EOL> from django . test . utils import override_settings <EOL> from djangobmf . widgets . country import gettext <EOL> from djangobmf . widgets . country import CountryContainer <EOL> from djangobmf . widgets . country import CountrySelect <EOL> class GettextTests ( TestCase ) : <EOL> @ override_settings ( USE_I18N = False , LANGUAGE_CODE = "<STR_LIT>" ) <EOL> def test_i18n_disabled ( self ) : <EOL> self . assertEqual ( gettext ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> @ override_settings ( USE_I18N = True , LANGUAGE_CODE = "<STR_LIT>" ) <EOL> def test_i18n_enabled ( self ) : <EOL> self . assertEqual ( gettext ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . assertEqual ( gettext ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> @ override_settings ( USE_I18N = True , LANGUAGE_CODE = "<STR_LIT>" ) <EOL> def test_i18n_non_existing_country ( self ) : <EOL> self . assertEqual ( gettext ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> @ override_settings ( USE_I18N = True , LANGUAGE_CODE = "<STR_LIT>" ) <EOL> class CountryContainerTests ( TestCase ) : <EOL> def setUp ( self ) : <EOL> self . container = CountryContainer ( '<STR_LIT>' ) <EOL> def test_name ( self ) : <EOL> self . assertEqual ( self . container . name , '<STR_LIT>' ) <EOL> def test_official_name ( self ) : <EOL> self . assertEqual ( self . container . official_name , '<STR_LIT>' ) <EOL> def test_int_name ( self ) : <EOL> self . assertEqual ( self . container . int_name , '<STR_LIT>' ) <EOL> def test_int_official_name ( self ) : <EOL> self . assertEqual ( self . container . int_official_name , '<STR_LIT>' ) <EOL> def test_key ( self ) : <EOL> self . assertEqual ( self . container . key , '<STR_LIT>' ) <EOL> def test_alpha2 ( self ) : <EOL> self . assertEqual ( self . container . alpha2 , '<STR_LIT>' ) <EOL> def test_alpha3 ( self ) : <EOL> self . assertEqual ( self . container . alpha3 , '<STR_LIT>' ) <EOL> def test_str ( self ) : <EOL> self . assertEqual ( '<STR_LIT:%s>' % self . container , '<STR_LIT>' ) <EOL> def test_len ( self ) : <EOL> self . assertEqual ( len ( self . container ) , <NUM_LIT:3> ) <EOL> @ override_settings ( USE_I18N = True , LANGUAGE_CODE = "<STR_LIT>" ) <EOL> class CountrySelectTests ( TestCase ) : <EOL> def test_empty_choices ( self ) : <EOL> select = CountrySelect ( ) <EOL> self . assertEqual ( len ( select . choices ) > <NUM_LIT:0> , True ) <EOL> def test_invalid_choice ( self ) : <EOL> with self . assertRaises ( KeyError ) : <EOL> CountrySelect ( choices = ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> def test_defined_choices ( self ) : <EOL> select = CountrySelect ( choices = ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> self . assertEqual ( select . choices , [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> ] ) </s>
