def testLanguageValidationMissingLang(self):
     from recensio.imports.excel_converter import ExcelConverter
     converter = ExcelConverter()
     converter._supported_languages = ('en', 'fr')
     self.assertEquals(
         ('en', 'fr'), converter.convertLanguages("en, fr, es"))
     self.assertEquals(
         ['The language "${lang}" is unknown'], converter.warnings)
 def unmaintained_testExcelConverterForZip(self):
     from recensio.imports.excel_converter import ExcelConverter
     converter = ExcelConverter()
     converter._supported_languages = ('de', 'en')
     xls = file(resource_filename(__name__,
                                  '../../../../recensio.imports/samples'
                                  '/recensioupload_DE_zip.xls'))
     results = list(converter.convert_zip(xls))
     self.assertEquals(2, len(results))
 def testLanguageValidationFunnyDividers(self):
     from recensio.imports.excel_converter import ExcelConverter
     converter = ExcelConverter()
     converter._supported_languages = ('en', 'fr')
     for i in ('en,fr', 'fr,en', 'fr,,en', 'fr:en', 'fr;en', 'fr.en',
               'fr    en', 'fr\nen', 'fr\ten', 'fr\ren'):
         self.assertEquals(
             set(('en', 'fr')), set(converter.convertLanguages(i)),
                           "%s not as expected" % str(i))
 def testLanguageValidationLowerEverything(self):
     from recensio.imports.excel_converter import ExcelConverter
     converter = ExcelConverter()
     converter._supported_languages = ('en', 'fr')
     self.assertEquals(('en', 'fr'), converter.convertLanguages("en, fr"))