~abompard/mailman/import21

« back to all changes in this revision

Viewing changes to src/mailman/utilities/tests/test_import.py

  • Committer: Aurélien Bompard
  • Date: 2013-10-15 07:27:18 UTC
  • Revision ID: aurelien@bompard.org-20131015072718-hl6v9a663b124v6y
Handle acceptable_aliases being a list in the pickle

Show diffs side-by-side

added added

removed removed

Lines of Context:
241
241
        self.assertEqual(sorted(alias_set.aliases),
242
242
                         [ ("^" + a) for a in aliases ])
243
243
 
 
244
    def test_acceptable_aliases_as_list(self):
 
245
        # in some versions of the pickle, it can be a list, not a string
 
246
        # (seen in the wild)
 
247
        aliases = [b"alias1@example.com", b"alias2@exemple.com" ]
 
248
        self._pckdict[b"acceptable_aliases"] = aliases
 
249
        try:
 
250
            self._import()
 
251
        except AttributeError:
 
252
            print(format_exc())
 
253
            self.fail("Import does not handle acceptable_aliases as list")
 
254
        alias_set = IAcceptableAliasSet(self._mlist)
 
255
        self.assertEqual(sorted(alias_set.aliases), aliases)
 
256
 
244
257
    def test_info_non_ascii(self):
245
258
        # info can contain non-ascii chars
246
259
        info = 'O idioma aceito \xe9 somente Portugu\xeas do Brasil'