示例#1
0
文件: tests.py 项目: ochan1/quark
    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())
示例#2
0
文件: tests.py 项目: nbailey/quark
    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())
示例#3
0
文件: tests.py 项目: ochan1/quark
    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())
示例#4
0
文件: tests.py 项目: nbailey/quark
    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())