Ticket #14016: ticket_14016.diff

File ticket_14016.diff, 1.3 KB (added by tzulberti, 14 years ago)
  • regressiontests/backends/tests.py

     
    4747        self.assertEqual(long_str, row[0].read())
    4848        c.execute('DROP TABLE ltext')
    4949
     50
     51class SQLiteCheckTest(unittest.TestCase):
     52
     53    def test_regression_14016(self):
     54        """
     55        Test the date compare values in sqllite - see #14016.
     56
     57        __: http://http://code.djangoproject.com/ticket/14016
     58
     59        """
     60        reporter = models.Reporter.objects.create(first_name='Django',
     61                                                  last_name='Spring')
     62        article = models.Article.objects.create(
     63                            reporter=reporter,
     64                            pub_date=datetime.date.today())
     65
     66
     67        self.assertEquals(len(models.Article.objects.all()), 1)
     68        articles = models.Article.objects.filter(
     69                            pub_date__gte = datetime.date.today())
     70        self.assertEquals(len(articles), 1)
     71        articles = models.Article.objects.filter(
     72                            pub_date__lte = datetime.date.today())
     73        self.assertEquals(len(articles), 1)
     74
    5075class DateQuotingTest(TestCase):
    5176
    5277    def test_django_date_trunc(self):
Back to Top