

def test_untranslated_get(self):
    '\n        Test the metaclass of the model.\n        '
    try:
        value = SimpleModel().tr_title
    except Exception as e:
        self.assertIsInstance(e, TranslationDoesNotExist)
        self.assertIsInstance(e, AttributeError)
    else:
        self.fail('Expected exception from reading untranslated title, got {0}.'.format(repr(value)))
    self.assertEqual(getattr(SimpleModel(), 'tr_title', 'FOO'), 'FOO')
    self.assertFalse(hasattr(SimpleModel(), 'tr_title'))

dataset/ETHPy150Open edoburu/django-parler/parler/tests/test_model_attributes.py ModelAttributeTests.test_untranslated_get/original