~barry/mailman/templatecache

« back to all changes in this revision

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

  • Committer: Barry Warsaw
  • Date: 2012-10-31 16:37:22 UTC
  • mfrom: (7178.1.1 work2)
  • Revision ID: barry@list.org-20121031163722-3lszhsiv9ai0akfp
 * Python 2.7 is not required.  Python 2.6 is no longer officially supported.
   The code base is now also `python2.7 -3` clean, although there are still
   some warnings in 3rd party dependencies.  LP: #1073506

Show diffs side-by-side

added added

removed removed

Lines of Context:
224
224
        self.assertEqual(self.fp.read(), 'List template')
225
225
 
226
226
    def test_template_not_found(self):
227
 
        # Python 2.6 compatibility.
228
 
        try:
 
227
        with self.assertRaises(TemplateNotFoundError) as cm:
229
228
            find('missing.txt', self.mlist)
230
 
        except TemplateNotFoundError as error:
231
 
            self.assertEqual(error.template_file, 'missing.txt')
232
 
        else:
233
 
            raise AssertionError('TemplateNotFoundError expected')
 
229
        self.assertEqual(cm.exception.template_file, 'missing.txt')
234
230
 
235
231
 
236
232