

def test_any_fallback_function(self):
    x = SimpleModel()
    x.set_current_language(self.other_lang1)
    x.tr_title = 'TITLE_XX'
    x.save()
    with translation.override(self.other_lang2):
        x = SimpleModel.objects.get(pk=x.pk)
        self.assertRaises(TranslationDoesNotExist, (lambda : x._get_translated_model(use_fallback=True)))
        x.assertIs(x.safe_translation_getter('tr_title', 'DEFAULT'), 'DEFAULT')
        self.assertEqual(x.safe_translation_getter('tr_title', any_language=True), 'TITLE_XX')
        self.assertNumQueries(0, (lambda : x._get_any_translated_model()))
        self.assertEqual(x._get_any_translated_model().language_code, self.other_lang1)

dataset/ETHPy150Open edoburu/django-parler/parler/tests/test_model_attributes.py ModelAttributeTests.test_any_fallback_function/VarMisuse@84/111 `self`->`x`