Example #1
0
 def test_close_expired(self):
     """Projects past their due date should be closed"""
     crowdfund = models.Crowdfund.objects.create(
         name='Cool project please help',
         date_due=(date.today() - timedelta(1)),
         payment_required=20.00,
     )
     tasks.close_expired()
     updated_crowdfund = models.Crowdfund.objects.get(pk=crowdfund.pk)
     ok_(updated_crowdfund.closed,
         'Any crowdfund past its date due should be closed.')
Example #2
0
 def test_do_not_close_today(self):
     """Projects with a due date of today should not be clsoed."""
     crowdfund = models.Crowdfund.objects.create(
         name='Cool project please help',
         date_due=(date.today()),
         payment_required=20.00,
     )
     crowdfund.save()
     tasks.close_expired()
     updated_crowdfund = models.Crowdfund.objects.get(pk=crowdfund.pk)
     ok_(not updated_crowdfund.closed,
         'Crowdfunds with a due date of today should not be closed.')