Ticket #12567: testcase.diff

File testcase.diff, 960 bytes (added by Alex Gaynor, 15 years ago)

a test case

  • tests/regressiontests/model_inheritance_regress/models.py

    diff --git a/tests/regressiontests/model_inheritance_regress/models.py b/tests/regressiontests/model_inheritance_regress/models.py
    index c669b23..c3a8c07 100644
    a b import datetime  
    66
    77from django.db import models
    88
    9 # Python 2.3 doesn't have sorted()
    10 try:
    11     sorted
    12 except NameError:
    13     from django.utils.itercompat import sorted
    149
    1510class Place(models.Model):
    1611    name = models.CharField(max_length=50)
    AttributeError: 'Person' object has no attribute 'messybachelorparty_set'  
    385380>>> p4.bachelorparty_set.all()
    386381[<BachelorParty: Bachelor party for Bob>, <BachelorParty: Bachelor party for Dave>]
    387382
    388 """}
     383# This works
     384>>> Place.objects.exclude(restaurant=None)
     385[<Place:  the place>]
    389386
     387# ... and this doesn't.
     388>>> Place.objects.filter(restaurant__isnull=False)
     389[<Place:  the place>]
     390"""}
Back to Top