def test_codelist_name(self): """ Test retrieving a codelist name. """ sector = Sector.objects.create(project=self.project, sector_code='140') name = codelist_name(CodelistSector, sector, 'sector_code', version='16') self.assertEqual(name, '140')
def currency_label(self): return codelist_name(Currency, self, "currency")
def currency_label(self): return codelist_name(Currency, self, 'currency')
def iati_currency(self): if self.currency: return codelist_name(Currency, self, 'currency') else: return codelist_name(Currency, self.project, 'currency')