view test/test_init.py @ 5168:9e41254430fe

issue2550755: exceptions.NotFound(msg) msg is not reported to user in cgi fix tests Correct tests so they now expect NotFound exception rather than SeriousError. Renamed: test/test_cgi.py::FormTestCase::testCSVExportFailPermission to test/test_cgi.py::FormTestCase::testCSVExportFailPermissionBadColumn I think this test should return Unauthorised rather than NotFound. Discussion is on the issue. Also added a new test case to verify that exceptions.Unauthorised is raised if all columns are valid and the user is not allowed to access the class.
author John Rouillard <rouilj@ieee.org>
date Thu, 01 Sep 2016 21:26:59 -0400
parents 364c54991861
children 198b6e810c67
line wrap: on
line source

#-*- encoding: utf8 -*-

import unittest, os, pprint, difflib, textwrap

from roundup.init import loadTemplateInfo


class TemplateInfoTestCase(unittest.TestCase):
    def testLoadTemplateInfo(self):
        path = os.path.join(os.path.dirname(__file__),
                            '../share/roundup/templates/classic')
        self.maxDiff = None
        self.assertEqual(
            loadTemplateInfo(path),
            {
              'description': textwrap.dedent('''\
                   This is a generic issue tracker that may be used to track bugs,
                                feature requests, project issues or any number of other types
                                of issues. Most users of Roundup will find that this template
                                suits them, with perhaps a few customisations.'''),
              'intended-for': 'All first-time Roundup users',
              'name': 'classic',
              'path': path
            }
        )

# vim: set et sts=4 sw=4 :

Roundup Issue Tracker: http://roundup-tracker.org/