Ticket #5246: mssql_tests.patch
File mssql_tests.patch, 2.2 KB (added by , 17 years ago) |
---|
-
modeltests/lookup/models.py
274 274 >>> a4.save() 275 275 >>> a5 = Article(pub_date=now, headline='hey-Foo') 276 276 >>> a5.save() 277 """} 277 278 279 280 if settings.DATABASE_ENGINE not in ('mssql',): 281 __test__['API_TESTS'] += r""" 278 282 # zero-or-more 279 283 >>> Article.objects.filter(headline__regex=r'fo*') 280 284 [<Article: f>, <Article: fo>, <Article: foo>, <Article: fooo>] … … 288 292 # wildcard 289 293 >>> Article.objects.filter(headline__regex=r'fooo?') 290 294 [<Article: foo>, <Article: fooo>] 295 """ 291 296 297 298 299 __test__['API_TESTS'] += r""" 292 300 # and some more: 293 301 >>> a6 = Article(pub_date=now, headline='bar') 294 302 >>> a6.save() … … 298 306 >>> a8.save() 299 307 >>> a9 = Article(pub_date=now, headline='baxZ') 300 308 >>> a9.save() 309 """ 301 310 311 312 if settings.DATABASE_ENGINE not in ('mssql',): 313 __test__['API_TESTS'] += r""" 302 314 # leading anchor 303 315 >>> Article.objects.filter(headline__regex=r'^b') 304 316 [<Article: bar>, <Article: baxZ>, <Article: baz>] … … 318 330 [<Article: baxZ>] 319 331 >>> Article.objects.filter(headline__iregex=r'ba[RxZ]') 320 332 [<Article: bar>, <Article: baxZ>, <Article: baz>] 333 """ 321 334 335 336 __test__['API_TESTS'] += r""" 322 337 # and yet more: 323 338 >>> a10 = Article(pub_date=now, headline='foobar') 324 339 >>> a10.save() … … 334 349 >>> a15.save() 335 350 >>> a16 = Article(pub_date=now, headline='bazbaRFOO') 336 351 >>> a16.save() 352 """ 337 353 354 355 if settings.DATABASE_ENGINE not in ('mssql',): 356 __test__['API_TESTS'] += r""" 338 357 # alternation 339 358 >>> Article.objects.filter(headline__regex=r'oo(f|b)') 340 359 [<Article: barfoobaz>, <Article: foobar>, <Article: foobarbaz>, <Article: foobaz>] … … 348 367 [<Article: barfoobaz>, <Article: baz>, <Article: bazbaRFOO>, <Article: foobarbaz>, <Article: foobaz>] 349 368 >>> Article.objects.filter(headline__iregex=r'b.*ar') 350 369 [<Article: bar>, <Article: barfoobaz>, <Article: bazbaRFOO>, <Article: foobar>, <Article: foobarbaz>] 351 """ }370 """ 352 371 353 372 354 if settings.DATABASE_ENGINE not in ('mysql', 'mysql_old' ):373 if settings.DATABASE_ENGINE not in ('mysql', 'mysql_old', 'mssql'): 355 374 __test__['API_TESTS'] += r""" 356 375 # grouping and backreferences 357 376 >>> Article.objects.filter(headline__regex=r'b(.).*b\1')