def test_it_leaves_valid_tickets(self, db_session, factories): tickets = [ factories.AuthTicket(expires=datetime(2014, 5, 6, 7, 8, 9)), factories.AuthTicket(expires=(datetime.utcnow() + timedelta(hours=1))), ] db_session.add_all(tickets) assert db_session.query(AuthTicket).count() == 2 purge_expired_auth_tickets() assert db_session.query(AuthTicket).count() == 1
def test_it_leaves_valid_tickets(self, db_session, factories): tickets = [ factories.AuthTicket(expires=datetime(2014, 5, 6, 7, 8, 9)), factories.AuthTicket(expires=(datetime.utcnow() + timedelta(hours=1))), ] db_session.add_all(tickets) assert db_session.query(AuthTicket).count() == 2 purge_expired_auth_tickets() assert db_session.query(AuthTicket).count() == 1