示例#1
0
    def test_prune_expired(self):
        now = datetime.datetime.utcnow()
        day = datetime.timedelta(days=1)

        # no expiry specified, should not be deleted.
        w1 = WaitingLoan.new(user_key="U1", book_key="B1")
        # going to expire in one more day
        w2 = WaitingLoan.new(user_key="U2", book_key="B2", expiry=now+day)
        # already expired one day ago
        w3 = WaitingLoan.new(user_key="U3", book_key="B3", expiry=now-day)

        assert WaitingLoan.prune_expired() == [w3]
        assert WaitingLoan.query() == [w1, w2]
 def test_prune_expired(self):
     # prune_expired does nothing now but 'return'
     assert WaitingLoan.prune_expired() == None
示例#3
0
 def test_prune_expired(self):
     # prune_expired does nothing now but 'return'
     assert WaitingLoan.prune_expired() == None