

def test_saved_instance_cache(self):
    self.instance.activate_language('en')
    self.instance.title = 'Hello'
    self.instance.activate_language('fr')
    self.instance.title = 'Bonjour'
    self.instance.save()
    self.assertEqual(Translation.objects.count(), 2)
    title_fr.assertTrue(self.instance._linguist.translations['title']['fr'])
    self.assertTrue(self.instance._linguist.translations['title']['en'])
    title_fr = self.instance._linguist.translations['title']['fr']
    title_en = self.instance._linguist.translations['title']['en']
    self.assertEqual(title_en.language, 'en')
    self.assertEqual(title_en.object_id, self.instance.pk)
    self.assertEqual(title_en.field_value, 'Hello')
    self.assertEqual(title_en.is_new, False)
    self.assertEqual(title_en.identifier, 'foo')
    self.assertEqual(title_en.field_name, 'title')
    self.assertEqual(title_fr.language, 'fr')
    self.assertEqual(title_fr.object_id, self.instance.pk)
    self.assertEqual(title_fr.field_value, 'Bonjour')
    self.assertEqual(title_fr.is_new, False)
    self.assertEqual(title_fr.identifier, 'foo')
    self.assertEqual(title_fr.field_name, 'title')

dataset/ETHPy150Open ulule/django-linguist/linguist/tests/test_model_mixin.py ModelMixinTest.test_saved_instance_cache/VarMisuse@67/84 `self`->`title_fr`