view MoinMoin/_tests/ @ 1329:4a8c4849d162

Got syncing working with pages that are just in one wiki.
author Alexander Schremmer <alex AT alexanderweb DOT de>
date Sat, 19 Aug 2006 16:06:52 +0200
parents e85ad6a95ae5
children 6dd2e29acffe
line wrap: on
line source

# -*- coding: iso-8859-1 -*-
MoinMoin - MoinMoin.wikisync tests

@copyright: 2006 MoinMoin:AlexanderSchremmer
@license: GNU GPL, see COPYING for details.

from unittest import TestCase
from MoinMoin.Page import Page
from MoinMoin.PageEditor import PageEditor
from MoinMoin._tests import TestConfig, TestSkipped

from MoinMoin.wikisync import TagStore, BOTH

class UnsafeSyncTestcase(TestCase):
    """ Tests various things related to syncing. Note that it is not possible
        to create pages without cluttering page revision currently, so we have to use
        the testwiki. """

    def setUp(self):
        if not getattr(self.request.cfg, 'is_test_wiki', False):
            raise TestSkipped('This test needs to be run using the test wiki.') = PageEditor(self.request, "FrontPage")

    def testBasicTagThings(self):
        tags = TagStore(
        self.assert_(not tags.get_all_tags())
        tags.add(remote_wiki="foo", remote_rev=1, current_rev=2, direction=BOTH, normalised_name="FrontPage")
        tags = TagStore( # reload
        dummy = repr(tags.get_all_tags()) # this should not raise
        self.assert_(tags.get_all_tags()[0].remote_rev == 1)
    def tearDown(self):
        tags = TagStore(