Exemple #1
0
 def test_get_last_history(self):
     u = User()
     u.save()
     s = Scenario(attributes={'id': '111'}, response='bbb')
     s.save()
     h = History(scenario=s.to_dict(), user=u)
     h.save()
     h = History(scenario=s.to_dict(), user=u)
     h.save()
     eq_(h.id, self.client.globals(u.id)['last_history']().id)
Exemple #2
0
 def test_isonce_in_history(self):
     u = User()
     u.save()
     s = Scenario(attributes={'id': '111'}, response='bbb')
     s.save()
     h = History(scenario=s.to_dict(), user=u)
     h.save()
     eq_(False, self.client.globals(u.id)['isonce'](s.attributes['id']))
Exemple #3
0
 def test_isonce_in_history_with_time(self):
     u = User()
     u.save()
     s = Scenario(attributes={'id': '111'}, response='bbb')
     s.save()
     h = History(scenario=s.to_dict(), user=u)
     h.save()
     eq_(
         False,
         self.client.globals(u.id)['isonce'](
             s.attributes['id'], period=datetime.timedelta(seconds=5)))