[CMF-checkins] CVS: Products/CMFCalendar/tests -
test_Event.py:1.5.22.4
Stefan H. Holek
stefan at epy.co.at
Wed Aug 4 16:55:03 EDT 2004
Update of /cvs-repository/Products/CMFCalendar/tests
In directory cvs.zope.org:/tmp/cvs-serv20993/tests
Modified Files:
Tag: CMF-1_4-branch
test_Event.py
Log Message:
Backported tests for Event PUT().
=== Products/CMFCalendar/tests/test_Event.py 1.5.22.3 => 1.5.22.4 ===
--- Products/CMFCalendar/tests/test_Event.py:1.5.22.3 Thu Jul 29 14:41:49 2004
+++ Products/CMFCalendar/tests/test_Event.py Wed Aug 4 16:55:03 2004
@@ -7,8 +7,13 @@
pass
from Products.CMFCalendar.Event import Event
+from Products.CMFCore.tests.base.dummy import DummySite
+from Products.CMFCore.tests.base.dummy import DummyTool
+from Products.CMFCore.tests.base.testcase import RequestTest
+
from DateTime import DateTime
+
class TestEvent(unittest.TestCase):
def test_new(self):
@@ -52,9 +57,36 @@
, startAMPM="AM"
)
+
+class EventPUTTests(RequestTest):
+
+ def setUp(self):
+ RequestTest.setUp(self)
+ self.site = DummySite('site')
+ self.site._setObject( 'portal_membership', DummyTool() )
+
+ def _makeOne(self, id, *args, **kw):
+ return self.site._setObject( id, Event(id, *args, **kw) )
+
+ def test_PutWithoutMetadata(self):
+ self.REQUEST['BODY'] = ''
+ d = self._makeOne('foo')
+ d.PUT(self.REQUEST, self.RESPONSE)
+ self.assertEqual( d.Title(), '' )
+ self.assertEqual( d.Format(), 'text/plain' )
+ self.assertEqual( d.Description(), '' )
+ self.assertEqual( d.Subject(), () )
+ self.assertEqual( d.Contributors(), () )
+ self.assertEqual( d.EffectiveDate(), 'None' )
+ self.assertEqual( d.ExpirationDate(), 'None' )
+ self.assertEqual( d.Language(), '' )
+ self.assertEqual( d.Rights(), '' )
+
+
def test_suite():
return unittest.TestSuite((
unittest.makeSuite( TestEvent ),
+ unittest.makeSuite( EventPUTTests ),
))
if __name__ == '__main__':
More information about the CMF-checkins
mailing list