Exemplo n.º 1
0
    def test_company_is_not_expired(self):
        """Make sure is_expired properly indicates non-expiration."""
        today = datetime.date.today()

        # Make the company's expiration date weeks in the future:
        expiration = today + datetime.timedelta(weeks=5)
        company = Company(name='Test Company', expiration_date=expiration)
        company.save()
        self.assertFalse(company.is_expired())

        # Move the expiration date to today, which should be the final
        # non-expired day:
        expiration = today
        company.expiration_date = expiration
        company.save()
        self.assertFalse(company.is_expired())
Exemplo n.º 2
0
    def test_company_is_not_expired(self):
        """Make sure is_expired properly indicates non-expiration."""
        today = datetime.date.today()

        # Make the company's expiration date weeks in the future:
        expiration = today + datetime.timedelta(weeks=5)
        company = Company(name='Test Company', expiration_date=expiration)
        company.save()
        self.assertFalse(company.is_expired())

        # Move the expiration date to today, which should be the final
        # non-expired day:
        expiration = today
        company.expiration_date = expiration
        company.save()
        self.assertFalse(company.is_expired())
Exemplo n.º 3
0
    def test_company_is_expired(self):
        """Make sure is_expired properly indicates expiration."""
        today = datetime.date.today()

        # Make the company's expiration in the past:
        expiration = today - datetime.timedelta(days=1)
        company = Company(name='Test Company', expiration_date=expiration)
        company.save()
        self.assertTrue(company.is_expired())
Exemplo n.º 4
0
    def test_company_is_expired(self):
        """Make sure is_expired properly indicates expiration."""
        today = datetime.date.today()

        # Make the company's expiration in the past:
        expiration = today - datetime.timedelta(days=1)
        company = Company(name='Test Company', expiration_date=expiration)
        company.save()
        self.assertTrue(company.is_expired())