Source

PylonsWikiNG / src / models / tutorial / tests.py

Full commit
import unittest

class WikiHandlerTests(unittest.TestCase):
    def setUp(self):
        from pylons.configuration import Configurator
        from tutorial.models import initialize_sql
        self.session = initialize_sql('sqlite://')
        self.config = Configurator()
        self.config.begin()

    def tearDown(self):
        self.config.end()

    def _makeOne(self, request):
        from tutorial.handlers import MyHandler
        return MyHandler(request)

    def test_index(self):
        request = DummyRequest()
        handler = self._makeOne(request)
        info = handler.index()
        self.assertEqual(info['project'], 'tutorial')
        self.assertEqual(info['root'].name, 'root')

class DummyRequest(object):
    pass