

def test_default_language_descriptor(self):
    m = DefaultLanguageFieldModel()
    self.assertEqual(m.lang, 'fr')
    self.assertEqual(m.default_language, 'fr')
    m.title_fr = 'Bonjour'
    m.title_en = 'Hello'
    m.save()
    self.assertEqual(m.cached_translations_count, 2)
    translation.activate('it')
    self.assertEqual(m.title, 'Bonjour')

dataset/ETHPy150Open ulule/django-linguist/linguist/tests/test_model_mixin.py ModelMixinTest.test_default_language_descriptor/original