def test_cleam(self): self.assertEquals(languages.clean('de'), 'de') self.assertEquals(languages.clean('xx'), None) self.assertEquals(languages.clean(None), None)
def add_language(self, language): self._meta_add('languages', languages.clean(language))
def add_language(self, language): self.meta.setdefault('languages', []) lang = languages.clean(language) if lang is not None and lang not in self.meta['languages']: self.meta['languages'].append(lang) self.update_meta()