comparison MoinMoin/events/_tests/test_events.py @ 6042:ca4a1bfdf2db

events tests: use PageEditor instances, like in the production code
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 01 Mar 2014 19:07:03 +0100
parents e5a9570d3001
children
comparison
equal deleted inserted replaced
6041:a3900f360ad0 6042:ca4a1bfdf2db
9 import py 9 import py
10 10
11 import MoinMoin.events as events 11 import MoinMoin.events as events
12 import MoinMoin.events.notification as notification 12 import MoinMoin.events.notification as notification
13 import MoinMoin.events.jabbernotify as jabbernotify 13 import MoinMoin.events.jabbernotify as jabbernotify
14 from MoinMoin.Page import Page 14 from MoinMoin.PageEditor import PageEditor
15 from MoinMoin.user import User 15 from MoinMoin.user import User
16 16
17 def test_get_handlers(request): 17 def test_get_handlers(request):
18 """Test if there are any event handlers. There should be some internal ones""" 18 """Test if there are any event handlers. There should be some internal ones"""
19 19
40 40
41 print "There should be at least a few subscribable events!" 41 print "There should be at least a few subscribable events!"
42 assert events.get_subscribable_events() 42 assert events.get_subscribable_events()
43 43
44 def test_page_change_message(request): 44 def test_page_change_message(request):
45 page = Page(request, "FrontPage") 45 page = PageEditor(request, "FrontPage")
46 46
47 print "Provided with a dumb change type argument, this should raise an exception!" 47 print "Provided with a dumb change type argument, this should raise an exception!"
48 py.test.raises(notification.UnknownChangeType, notification.page_change_message, 48 py.test.raises(notification.UnknownChangeType, notification.page_change_message,
49 "StupidType", request, page, "en", revisions=page.getRevList()) 49 "StupidType", request, page, "en", revisions=page.getRevList())
50 50