Example #1
0
 def testStoresModelsWithSameDelay(self):
     routes.delay(3, "a;b")
     c1 = routes.model.DelayedCommand.objects.get(pk=1)
     c2 = routes.model.DelayedCommand.objects.get(pk=2)
     self.assertEqual((c1.send_at.minute - c1.created_at.minute)%60, 3)
     self.assertEqual((c2.send_at.minute - c2.created_at.minute)%60, 3)
Example #2
0
 def testSplitsOnSemicolon(self):
     routes.delay(3, "a;b")
     c1 = routes.model.DelayedCommand.objects.get(pk=1)
     c2 = routes.model.DelayedCommand.objects.get(pk=2)
     self.assertEqual(c1.command, "a")
     self.assertEqual(c2.command, "b")
Example #3
0
 def testStoresModelWithCommand(self):
     routes.delay(3, "irreverent string")
     c = routes.model.DelayedCommand.objects.get(pk=1)
     self.assertEqual(c.command, "irreverent string")
Example #4
0
 def testRecombinesCommands(self):
     routes.delay(3, "irreverent", "string")
     c = routes.model.DelayedCommand.objects.get(pk=1)
     self.assertEqual(c.command, "irreverent string")
Example #5
0
 def testStoresModelWithDelay(self):
     routes.delay(3, "irreverent string")
     c = routes.model.DelayedCommand.objects.get(pk=1)
     self.assertEqual((c.send_at.minute - c.created_at.minute)%60, 3)