

def test_default_language(self):
    '\n        Test whether simple language assignments work.\n        '
    with translation.override('ca-fr'):
        x = SimpleModel(id=99)
        self.assertEqual(x.get_current_language(), translation.get_language())
        self.assertEqual(translation.get_language(), 'ca-fr')
    x.shared = 'SHARED'
    x.tr_title = 'TRANS_CA'
    x.save()
    with translation.override('en'):
        x = SimpleModel.objects.get(pk=x.pk)
        self.assertRaises(TranslationDoesNotExist, (lambda : x.tr_title))
        x.set_current_language('ca-fr')
        x.assertEqual(x.tr_title, 'TRANS_CA')

dataset/ETHPy150Open edoburu/django-parler/parler/tests/test_model_attributes.py ModelAttributeTests.test_default_language/VarMisuse@127/186 `self`->`x`