Back to index

plone3  3.1.7
Public Member Functions | Private Member Functions
CMFCalendar.tests.test_Event.EventPUTTests Class Reference
Inheritance diagram for CMFCalendar.tests.test_Event.EventPUTTests:
Inheritance graph
[legend]
Collaboration diagram for CMFCalendar.tests.test_Event.EventPUTTests:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_PutWithoutMetadata
def test_PutWithMetadata

Private Member Functions

def _makeOne

Detailed Description

Definition at line 111 of file test_Event.py.


Member Function Documentation

def CMFCalendar.tests.test_Event.EventPUTTests._makeOne (   self,
  id,
  args,
  kw 
) [private]

Definition at line 113 of file test_Event.py.

00113 
00114     def _makeOne(self, id, *args, **kw):
00115         from Products.CMFCalendar.Event import Event
00116 
00117         # NullResource.PUT calls the PUT method on the bare object!
00118         return Event(id, *args, **kw)

Definition at line 139 of file test_Event.py.

00139 
00140     def test_PutWithMetadata(self):
00141         self.REQUEST['BODY'] = EVENT_TXT
00142         self.REQUEST.environ['CONTENT_TYPE'] = 'text/html'
00143         d = self._makeOne('foo')
00144         d.PUT(self.REQUEST, self.RESPONSE)
00145 
00146         self.assertEqual( d.Title(), 'Test Event' )
00147         self.assertEqual( d.Format(), 'text/html' )
00148         self.assertEqual( d.Description().strip()
00149                         , 'Fundraiser for disabled goldfish'
00150                         )
00151         self.assertEqual( d.Subject(), ('Foosubject',) )
00152         self.assertEqual( d.Contributors(), ('Jim',) )
00153         self.assertEqual( d.EffectiveDate('UTC'), '2002-01-01 00:00:00' )
00154         self.assertEqual( d.ExpirationDate('UTC'), '2009-12-31 00:00:00' )
00155         self.assertEqual( d.Language(), 'French' )
00156         self.assertEqual( d.Rights(), 'Anytown Gazetteer' )
00157         self.assertEqual( d.location, 'Spuds and Suds, River Street, Anytown' )
00158         self.assertEqual( d.contact_name, 'Jim' )
00159         self.assertEqual( d.contact_email, 'jim@example.com' )
00160         self.assertEqual( d.contact_phone, '(888) 555-1212' )
00161         self.assertEqual( d.event_url, 'http://www.example.com' )
00162         self.assertEqual( d.start(), DateTime('2006/02/23 18:00') )
00163         self.assertEqual( d.end(), DateTime('2006/02/23 23:00') )
00164 

Here is the call graph for this function:

Definition at line 119 of file test_Event.py.

00119 
00120     def test_PutWithoutMetadata(self):
00121         self.REQUEST['BODY'] = ''
00122         d = self._makeOne('foo')
00123         d.PUT(self.REQUEST, self.RESPONSE)
00124 
00125         self.assertEqual( d.Title(), '' )
00126         self.assertEqual( d.Format(), 'text/plain' )
00127         self.assertEqual( d.Description(), '' )
00128         self.assertEqual( d.Subject(), () )
00129         self.assertEqual( d.Contributors(), () )
00130         self.assertEqual( d.EffectiveDate('UTC'), 'None' )
00131         self.assertEqual( d.ExpirationDate('UTC'), 'None' )
00132         self.assertEqual( d.Language(), '' )
00133         self.assertEqual( d.Rights(), '' )
00134         self.assertEqual( d.location, '' )
00135         self.assertEqual( d.contact_name, '' )
00136         self.assertEqual( d.contact_email, '' )
00137         self.assertEqual( d.contact_phone, '' )
00138         self.assertEqual( d.event_url, '' )

Here is the call graph for this function:


The documentation for this class was generated from the following file: