diff MoinMoin/macro/_tests/test_GetVal.py @ 2836:f5049c4cbf6e

wikidicts.dict: loads current dict. fixed and new tests
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Fri, 14 Sep 2007 12:53:23 +0200
parents 7d4a6e369a5a
children 5a3037bd131a
line wrap: on
line diff
--- a/MoinMoin/macro/_tests/test_GetVal.py	Fri Sep 14 00:43:22 2007 +0200
+++ b/MoinMoin/macro/_tests/test_GetVal.py	Fri Sep 14 12:53:23 2007 +0200
@@ -66,19 +66,7 @@
 
     def testGetValNoACLs(self):
         """ macro GetVal test: 'reads VAR' """
-        # py.test.skip("broken test")
-        # seems not to go well after test_PageEditor and test_events
-        # are both excluded it works e.g.
-        '''
-         py.test MoinMoin/_tests/test_Page.py MoinMoin/_tests/test_error.py
-         MoinMoin/_tests/test_packages.py MoinMoin/_tests/test_user.py
-         MoinMoin/_tests/test_wikidicts.py MoinMoin/_tests/test_wikisync.py
-         MoinMoin/_tests/test_wikiutil.py MoinMoin/action/_tests/test_attachfile.py
-         MoinMoin/config/_tests/test_multiconfig.py
-         MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py
-         MoinMoin/filter/_tests/test_filter.py MoinMoin/macro/_tests/test_Action.py
-         MoinMoin/formatter/_tests/test_formatter.py MoinMoin/macro/_tests/test_GetVal.py
-        '''
+
         self.shouldDeleteTestPage = True
         self._createTestPage(u' VAR:: This is an example')
 
@@ -89,6 +77,25 @@
         expected = "This is an example"
         assert result == expected
 
+    def testGetValAfterADictPageIsDeleted(self):
+        """ macro GetVal test: 'reads Dict var after another Dict is removed' """
+
+        self.shouldDeleteTestPage = True
+
+        pagename = u'SomeDict'
+        page = PageEditor(self.request, pagename, do_editor_backup=0)
+        body = u" EXAMPLE:: This is an example text"
+        page.saveText(body, 0)
+        success_i, result = page.deletePage()
+
+        self._createTestPage(u' VAR:: This is a brand new example')
+        page = Page(self.request, self.pagename)
+        args = "%s,%s" % (self.pagename, u'VAR')
+        result = self._test_macro(u'GetVal', args)
+
+        expected = "This is a brand new example"
+        assert result == expected
+
     def testGetValACLs(self):
         """ macro GetVal test: 'cant read VAR on an ACL protected page' """
         py.test.skip("user has no rights to create acl pages")