Ticket #24438: 0001-Add-a-passing-test-case.patch

File 0001-Add-a-passing-test-case.patch, 1.1 KB (added by Simon Charette, 9 years ago)
  • tests/lookup/tests.py

    From 3ce475f82234377e8ee2b97a69feee19b8792871 Mon Sep 17 00:00:00 2001
    From: Simon Charette <charette.s@gmail.com>
    Date: Mon, 2 Mar 2015 15:17:58 -0500
    Subject: [PATCH] Add a passing test case.
    
    ---
     tests/lookup/tests.py | 8 ++++++++
     1 file changed, 8 insertions(+)
    
    diff --git a/tests/lookup/tests.py b/tests/lookup/tests.py
    index 36b60a0..bc1a365 100644
    a b class LookupTests(TestCase):  
    593593                '<Article: foobarbaz>',
    594594            ])
    595595
     596        Article.objects.create(pub_date=now, headline='1,..')
     597        Article.objects.create(pub_date=now, headline='..,1,..')
     598        Article.objects.create(pub_date=now, headline='..,1')
     599        Article.objects.create(pub_date=now, headline='1')
     600        queryset = Article.objects.filter(headline__regex='^1,|,1,|,1$|^1$')
     601        self.assertEqual(queryset.count(), 4)
     602        print(queryset.query)
     603
    596604    @skipUnlessDBFeature('supports_regex_backreferencing')
    597605    def test_regex_backreferencing(self):
    598606        # grouping and backreferences
Back to Top