Beispiel #1
0
 def test_behavior_expires_redirect(self):
     fti = queryUtility(IDexterityFTI, name='sc.microsite')
     factory = fti.factory
     new_object = createObject(factory)
     behavior = SmartExpiration(new_object)
     behavior.expires_redirect = u'http://www.simplesconsultoria.com.br'
     # Armazenamento da data eh em property do objeto
     self.assertEqual(behavior.expires_redirect,
                      new_object.expires_redirect)
Beispiel #2
0
 def test_behavior_expires(self):
     fti = queryUtility(IDexterityFTI, name='sc.microsite')
     factory = fti.factory
     new_object = createObject(factory)
     behavior = SmartExpiration(new_object)
     behavior.expires = datetime.datetime(2014, 9, 7, 12, 0, 0)
     # Armazenamento da data eh em property do objeto
     self.assertEqual(behavior.expires.strftime('%Y-%m-%d'),
                      new_object.expiration_date.strftime('%Y-%m-%d'))
 def test_behavior_expires_redirect(self):
     fti = queryUtility(IDexterityFTI, name='sc.microsite')
     factory = fti.factory
     new_object = createObject(factory)
     behavior = SmartExpiration(new_object)
     behavior.expires_redirect = u'http://www.simplesconsultoria.com.br'
     # Armazenamento da data eh em property do objeto
     self.assertEqual(
         behavior.expires_redirect,
         new_object.expires_redirect
     )
 def test_behavior_expires(self):
     fti = queryUtility(IDexterityFTI, name='sc.microsite')
     factory = fti.factory
     new_object = createObject(factory)
     behavior = SmartExpiration(new_object)
     behavior.expires = datetime.datetime(2014, 9, 7, 12, 0, 0)
     # Armazenamento da data eh em property do objeto
     self.assertEqual(
         behavior.expires.strftime('%Y-%m-%d'),
         new_object.expiration_date.strftime('%Y-%m-%d')
     )