comparison 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
comparison
equal deleted inserted replaced
2835:9c4c20145a1f 2836:f5049c4cbf6e
64 self.request.reset() 64 self.request.reset()
65 self.page.saveText(body, 0) 65 self.page.saveText(body, 0)
66 66
67 def testGetValNoACLs(self): 67 def testGetValNoACLs(self):
68 """ macro GetVal test: 'reads VAR' """ 68 """ macro GetVal test: 'reads VAR' """
69 # py.test.skip("broken test") 69
70 # seems not to go well after test_PageEditor and test_events
71 # are both excluded it works e.g.
72 '''
73 py.test MoinMoin/_tests/test_Page.py MoinMoin/_tests/test_error.py
74 MoinMoin/_tests/test_packages.py MoinMoin/_tests/test_user.py
75 MoinMoin/_tests/test_wikidicts.py MoinMoin/_tests/test_wikisync.py
76 MoinMoin/_tests/test_wikiutil.py MoinMoin/action/_tests/test_attachfile.py
77 MoinMoin/config/_tests/test_multiconfig.py
78 MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py
79 MoinMoin/filter/_tests/test_filter.py MoinMoin/macro/_tests/test_Action.py
80 MoinMoin/formatter/_tests/test_formatter.py MoinMoin/macro/_tests/test_GetVal.py
81 '''
82 self.shouldDeleteTestPage = True 70 self.shouldDeleteTestPage = True
83 self._createTestPage(u' VAR:: This is an example') 71 self._createTestPage(u' VAR:: This is an example')
84 72
85 page = Page(self.request, self.pagename) 73 page = Page(self.request, self.pagename)
86 args = "%s,%s" % (self.pagename, u'VAR') 74 args = "%s,%s" % (self.pagename, u'VAR')
87 result = self._test_macro(u'GetVal', args) 75 result = self._test_macro(u'GetVal', args)
88 76
89 expected = "This is an example" 77 expected = "This is an example"
78 assert result == expected
79
80 def testGetValAfterADictPageIsDeleted(self):
81 """ macro GetVal test: 'reads Dict var after another Dict is removed' """
82
83 self.shouldDeleteTestPage = True
84
85 pagename = u'SomeDict'
86 page = PageEditor(self.request, pagename, do_editor_backup=0)
87 body = u" EXAMPLE:: This is an example text"
88 page.saveText(body, 0)
89 success_i, result = page.deletePage()
90
91 self._createTestPage(u' VAR:: This is a brand new example')
92 page = Page(self.request, self.pagename)
93 args = "%s,%s" % (self.pagename, u'VAR')
94 result = self._test_macro(u'GetVal', args)
95
96 expected = "This is a brand new example"
90 assert result == expected 97 assert result == expected
91 98
92 def testGetValACLs(self): 99 def testGetValACLs(self):
93 """ macro GetVal test: 'cant read VAR on an ACL protected page' """ 100 """ macro GetVal test: 'cant read VAR on an ACL protected page' """
94 py.test.skip("user has no rights to create acl pages") 101 py.test.skip("user has no rights to create acl pages")