Exemplo n.º 1
0
 def test_ignore_before_timeout(self):
     for i in range(0,5):
         IncomingMessage(text="123",identity=str(self.conn.identity), 
                         backend=str(self.conn.backend), 
                         received=datetime.now()).save()
     # this is a bot
     self.assertTrue( _test_and_set_bot(self.conn) )
Exemplo n.º 2
0
 def test_allow_after_timeout(self):
     for i in range(0,5):
         IncomingMessage(text="123",identity=str(self.conn.identity), 
                         backend=str(self.conn.backend), 
                         received=datetime.now() - timedelta(minutes=5)
                         ).save()
     # this is not a bot
     self.assertFalse( _test_and_set_bot(self.conn) )