Ticket #21643: 0001-Add-a-regression-test-for-21643.patch

File 0001-Add-a-regression-test-for-21643.patch, 1.0 KB (added by despawn@…, 11 years ago)

Regression test.

  • tests/expressions_regress/tests.py

    From d0bc352cd730cd1ede6e457ed4320405e924327c Mon Sep 17 00:00:00 2001
    From: Alexey Shelf <despawn@gmail.com>
    Date: Fri, 20 Dec 2013 15:23:37 +0400
    Subject: [PATCH] Add a regression test for #21643.
    
    ---
     tests/expressions_regress/tests.py | 7 +++++++
     1 file changed, 7 insertions(+)
    
    diff --git a/tests/expressions_regress/tests.py b/tests/expressions_regress/tests.py
    index e603c41..7533e4e 100644
    a b class FTimeDeltaTests(TestCase):  
    274274        self.days_long.append(e4.completed - e4.assigned)
    275275        self.expnames = [e.name for e in Experiment.objects.all()]
    276276
     277    def test_multiple_query_compilation(self):
     278        # Ticket #21643
     279        queryset = Experiment.objects.filter(end__lt=F('start') + datetime.timedelta(hours=1))
     280        q1 = str(queryset.query)
     281        q2 = str(queryset.query)
     282        self.assertEqual(q1, q2)
     283
    277284    def test_delta_add(self):
    278285        for i in range(len(self.deltas)):
    279286            delta = self.deltas[i]
Back to Top