Code

Ticket #5246: mssql_tests.patch

File mssql_tests.patch, 2.2 KB (added by Filip Wasilewski <filip.wasilewski@…>, 7 years ago)

Exclude regular expressions tests

  • modeltests/lookup/models.py

     
    274274>>> a4.save() 
    275275>>> a5 = Article(pub_date=now, headline='hey-Foo') 
    276276>>> a5.save() 
     277"""} 
    277278 
     279 
     280if settings.DATABASE_ENGINE not in ('mssql',): 
     281    __test__['API_TESTS'] += r""" 
    278282# zero-or-more 
    279283>>> Article.objects.filter(headline__regex=r'fo*') 
    280284[<Article: f>, <Article: fo>, <Article: foo>, <Article: fooo>] 
     
    288292# wildcard 
    289293>>> Article.objects.filter(headline__regex=r'fooo?') 
    290294[<Article: foo>, <Article: fooo>] 
     295""" 
    291296 
     297 
     298 
     299__test__['API_TESTS'] += r""" 
    292300# and some more: 
    293301>>> a6 = Article(pub_date=now, headline='bar') 
    294302>>> a6.save() 
     
    298306>>> a8.save() 
    299307>>> a9 = Article(pub_date=now, headline='baxZ') 
    300308>>> a9.save() 
     309""" 
    301310 
     311 
     312if settings.DATABASE_ENGINE not in ('mssql',): 
     313    __test__['API_TESTS'] += r""" 
    302314# leading anchor 
    303315>>> Article.objects.filter(headline__regex=r'^b') 
    304316[<Article: bar>, <Article: baxZ>, <Article: baz>] 
     
    318330[<Article: baxZ>] 
    319331>>> Article.objects.filter(headline__iregex=r'ba[RxZ]') 
    320332[<Article: bar>, <Article: baxZ>, <Article: baz>] 
     333""" 
    321334 
     335 
     336__test__['API_TESTS'] += r""" 
    322337# and yet more: 
    323338>>> a10 = Article(pub_date=now, headline='foobar') 
    324339>>> a10.save() 
     
    334349>>> a15.save() 
    335350>>> a16 = Article(pub_date=now, headline='bazbaRFOO') 
    336351>>> a16.save() 
     352""" 
    337353 
     354 
     355if settings.DATABASE_ENGINE not in ('mssql',): 
     356    __test__['API_TESTS'] += r""" 
    338357# alternation 
    339358>>> Article.objects.filter(headline__regex=r'oo(f|b)') 
    340359[<Article: barfoobaz>, <Article: foobar>, <Article: foobarbaz>, <Article: foobaz>] 
     
    348367[<Article: barfoobaz>, <Article: baz>, <Article: bazbaRFOO>, <Article: foobarbaz>, <Article: foobaz>] 
    349368>>> Article.objects.filter(headline__iregex=r'b.*ar') 
    350369[<Article: bar>, <Article: barfoobaz>, <Article: bazbaRFOO>, <Article: foobar>, <Article: foobarbaz>] 
    351 """} 
     370""" 
    352371 
    353372 
    354 if settings.DATABASE_ENGINE not in ('mysql', 'mysql_old'): 
     373if settings.DATABASE_ENGINE not in ('mysql', 'mysql_old', 'mssql'): 
    355374    __test__['API_TESTS'] += r""" 
    356375# grouping and backreferences 
    357376>>> Article.objects.filter(headline__regex=r'b(.).*b\1')