[PatchDiscussion] More functional tests: recentchanges and options

[email protected] (zwiki-repo)
Newsgroups gmane.comp.web.zope.zwiki
Message-ID <20080213123346.4961C7802C__45472.3921757706$1202906125$gmane$org@mail.joyful.com>
Wed Feb 13 03:20:39 PST 2008  [email protected]
  * More functional tests: recentchanges and options
diff -rN -u old-ZWiki/functional.txt new-ZWiki/functional.txt
--- old-ZWiki/functional.txt	2008-02-13 04:33:45.000000000 -0800
+++ new-ZWiki/functional.txt	2008-02-13 04:33:45.000000000 -0800
@@ -132,3 +132,63 @@
     >>> browser.contents
     '...I like me some text here...'
 
+Let's see if our edits show up in recentchanges!
+
+    >>> changes = browser.getLink('changes')
+    >>> changes.click()
+    >>> browser.url
+    '.../FrontPage/recentchanges'
+    >>> browser.contents
+    '...Pages changed in the last...'
+    >>> 'My First Wiki Page' in browser.contents
+    True
+
+Our revert should show up too:
+
+    >>> 'FrontPage' in browser.contents
+    True
+    >>> 'reverted by ' + user_name in browser.contents
+    True
+
+Clicking on our username shows us a "page does not exist" message.
+But I don't yet know how to test for the resulting traceback.
+
+Instead let's try some of the buttons, 'month' and 'ever':
+
+    >>> month = browser.getControl('month')
+    >>> month.click()
+    >>> 'My First Wiki Page' in browser.contents
+    True
+    >>> 'FrontPage' in browser.contents
+    True
+    >>> 'WikiWikiWeb' in browser.contents
+    False
+    >>> ever = browser.getControl('ever')
+    >>> ever.click()
+    >>> 'My First Wiki Page' in browser.contents
+    True
+    >>> 'WikiWikiWeb' in browser.contents
+    True
+
+Setting options - maybe we should test this with an anonymous user
+and the wiki set to allow anonymous edits with options set only.
+For now it's still our manager user.
+
+    >>> mypage = browser.getLink('My First Wiki Page')
+    >>> mypage.click()
+    >>> options_l = browser.getLink('options')
+    >>> options_l.click()
+    >>> 'FrontPage/useroptions?redirectURL=http%3A//' in browser.url
+    True
+    >>> browser.contents
+    '...Set your preferences for this wiki:...'
+    >>> zwiki_username = browser.getControl(name='zwiki_username')
+    >>> email = browser.getControl(name='email')
+    >>> zwiki_timezone = browser.getControl(name='zwiki_timezone')
+    >>> zwiki_height = browser.getControl(name='zwiki_height')
+    >>> zwiki_username.value
+    ''
+    >>> email.value
+    ''
+    >>> zwiki_height.value
+    '20'

--
forwarded from http://zwiki.org/PatchDiscussion#[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.