Exemple #1
0
 def test_cleam(self):
     self.assertEquals(languages.clean('de'), 'de')
     self.assertEquals(languages.clean('xx'), None)
     self.assertEquals(languages.clean(None), None)
Exemple #2
0
 def add_language(self, language):
     self._meta_add('languages', languages.clean(language))
Exemple #3
0
 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()