Did I find the right examples for you? yes no

All Samples(6)  |  Call(6)  |  Derive(0)  |  Import(0)

src/p/r/Products.CMFPlone-5.0a2/Products/CMFPlone/tests/testLoggedIn.py   Products.CMFPlone(Download)
    def testInitialLoginTimeWithString(self):
        member = self.membership.getAuthenticatedMember()
        # Realize the login_time is not string but DateTime
        self.assertIsInstance(member.getProperty('login_time'), DateTime)
        self.assertEqual(member.getProperty('login_time').Date(), '2000/01/01')
 
        # Update login_time into string
        today = DateTime().Date()
        member.setProperties(login_time=today)
        self.assertIsInstance(member.getProperty('login_time'), str)
        self.portal.logged_in()
        member = self.membership.getAuthenticatedMember()
        self.assertIsInstance(member.getProperty('login_time'), DateTime)
        self.assertTrue(member.getProperty('login_time') > DateTime(today))
 

src/p/r/Products.CMFPlone-HEAD/Products/CMFPlone/tests/testLoggedIn.py   Products.CMFPlone(Download)
    def testInitialLoginTimeWithString(self):
        member = self.membership.getAuthenticatedMember()
        # Realize the login_time is not string but DateTime
        self.assertIsInstance(member.getProperty('login_time'), DateTime)
        self.assertEqual(member.getProperty('login_time').Date(), '2000/01/01')
 
        # Update login_time into string
        today = DateTime().Date()
        member.setProperties(login_time=today)
        self.assertIsInstance(member.getProperty('login_time'), str)
        self.portal.logged_in()
        member = self.membership.getAuthenticatedMember()
        self.assertIsInstance(member.getProperty('login_time'), DateTime)
        self.assertTrue(member.getProperty('login_time') > DateTime(today))