def title(self): if self._title is not None: return self._title try: return get_verbose_name(self.model, self.attr) except AttributeError: return self.attr.split(".")[-1].replace("_", " ").title()
def test_get_verbose_name(): l = get_verbose_name(SimpleDemoModel, 'char') assert l == 'Character'