changeset 2327:e6ebe6853e51

Unit test; check if page_change_message() raises an exception.
author Karol Nowak <grzywacz@sul.uni.lodz.pl>
date Mon, 25 Jun 2007 15:05:30 +0200
parents cbad6fb20f2d
children 495b09143c10
files MoinMoin/_tests/test_events.py
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/test_events.py	Mon Jun 25 12:53:25 2007 +0200
+++ b/MoinMoin/_tests/test_events.py	Mon Jun 25 15:05:30 2007 +0200
@@ -6,8 +6,11 @@
     @license: GNU GPL, see COPYING for details.
 """
 
+import py
+
 import MoinMoin.events as events
 import MoinMoin.events.notification as notification
+from MoinMoin.Page import Page
 
 def test_get_handlers(request):
     """Test if there are any event handlers. There should be some internal ones"""
@@ -34,5 +37,12 @@
     
     print "There should be at least a few subscribable events!"
     assert events.get_subscribable_events()
+
+def test_page_change_message(request):
+    page = Page(request, "FrontPage")
+    
+    print "Provided with a dumb change type argument, this should raise an exception!"
+    py.test.raises(notification.UnknownChangeType, notification.page_change_message, 
+                   "StupidType", request, page, "en", revisions=page.getRevList())
     
 coverage_modules = ["MoinMoin.events"]