Пример #1
0
 def test_time_remaining_one_message(self):
     # if there are any messages at all, should still return a True value for the template
     batch = BatchFactory(status=Batch.PENDING)
     BulkMessageFactory(batch=batch, sms=None)
     # using assertTrue because the key is that we want the return value to be boolean True
     # for the template to NOT display the 'Finished' default
     self.assertTrue(batch.time_remaining())
Пример #2
0
 def test_time_remaining_one_message(self):
     # if there are any messages at all, should still return a True value for the template
     batch = BatchFactory(status=Batch.PENDING)
     BulkMessageFactory(batch=batch, sms=None)
     # using assertTrue because the key is that we want the return value to be boolean True
     # for the template to NOT display the 'Finished' default
     self.assertTrue(batch.time_remaining())
Пример #3
0
 def test_time_remaining(self):
     batch = BatchFactory(status=Batch.PENDING)
     [
         BulkMessageFactory(deleted=True, batch=batch, sms=None)
         for i in range(5)
     ]
     msgs = [BulkMessageFactory(batch=batch, sms=None) for i in range(10)]
     self.assertEqual(batch.time_remaining(),
                      datetime.timedelta(seconds=len(msgs) / 2))
Пример #4
0
 def test_time_remaining_zero_messages(self):
     batch = BatchFactory(status=Batch.PENDING)
     self.assertEqual(batch.time_remaining(), 0)
Пример #5
0
 def test_time_remaining(self):
     batch = BatchFactory(status=Batch.PENDING)
     [BulkMessageFactory(deleted=True, batch=batch, sms=None) for i in range(5)]
     msgs = [BulkMessageFactory(batch=batch, sms=None) for i in range(10)]
     self.assertEqual(batch.time_remaining(), datetime.timedelta(seconds=len(msgs) / 2))
Пример #6
0
 def test_time_remaining_zero_messages(self):
     batch = BatchFactory(status=Batch.PENDING)
     self.assertEqual(batch.time_remaining(), 0)