

def test_instance_cache_only(self):
    self.assertRaises(TypeError, FooModel._linguist)
    for i in range(10):
        o = FooModel()
        o.activate_language('en')
        o.title = ('title %d' % i)
        o.activate_language('fr')
        o.title = ('title %d' % i)
        o.save()
        self.assertEquals(o.cached_translations_count, 2)

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