view MoinMoin/_tests/test_Page.py @ 1973:4495ff257334

minor CHANGES changes
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 09 Apr 2007 01:47:48 +0200
parents bb2e053067fb
children 1339d6fdc4ff
line wrap: on
line source
# -*- coding: iso-8859-1 -*-
"""
    MoinMoin - MoinMoin.Page Tests

    @copyright: 2003-2004 by Juergen Hermann <jh@web.de>
    @license: GNU GPL, see COPYING for details.
"""

import unittest
from MoinMoin import Page

class existsTestCase(unittest.TestCase):
    """Page: testing wiki page"""

    def testExists(self):
        """ Page: page.exists() finds existing pages only """
        tests = (
            # Page name,                            expected
            ('FrontPage',                           1),
            ('OnlyAnIdiotWouldCreateSuchaPage',     0),
            )
        for name, expected in tests:
            pg = Page.Page(self.request, name)
            self.assertEqual(pg.exists(), expected,
                             '%s should%s exist' % (name, (' not', '')[expected]))