<s> from pyquery import PyQuery as pq <EOL> from nose . tools import eq_ <EOL> from django . forms import ModelForm <EOL> from olympia . amo . tests import TestCase <EOL> from olympia . translations import forms , fields <EOL> from olympia . translations . tests . testapp . models import TranslatedModel <EOL> class TestForm ( forms . TranslationFormMixin , ModelForm ) : <EOL> name = fields . TransField ( ) <EOL> class Meta : <EOL> model = TranslatedModel <EOL> class TestTranslationFormMixin ( TestCase ) : <EOL> def test_default_locale ( self ) : <EOL> obj = TranslatedModel ( ) <EOL> obj . get_fallback = lambda : '<STR_LIT>' <EOL> f = TestForm ( instance = obj ) <EOL> eq_ ( f . fields [ '<STR_LIT:name>' ] . default_locale , '<STR_LIT>' ) <EOL> eq_ ( f . fields [ '<STR_LIT:name>' ] . widget . default_locale , '<STR_LIT>' ) <EOL> eq_ ( pq ( f . as_p ( ) ) ( '<STR_LIT>' ) . attr ( '<STR_LIT>' ) , '<STR_LIT>' ) </s>
