

def test_language_fields(self):
    m = FooModel(title_en='hello', title_fr='bonjour')
    m.save()
    self.assertEqual(m.title_en, 'hello')
    self.assertEqual(m.title_fr, 'bonjour')
    m = DefaultLanguageFieldModel(title_en='hello', title_fr='bonjour', lang='en')
    m.save()
    self.assertEqual(m.title_en, 'hello')
    self.assertEqual(m.title_fr, 'bonjour')
    m = DefaultLanguageFieldModelWithCallable(title_en='hello', title_fr='bonjour')
    m.save()
    self.assertEqual(m.title_en, 'hello')
    self.assertEqual(m.title_fr, 'bonjour')

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