Ticket #13203: 13203_r12773.tests.diff
File 13203_r12773.tests.diff, 1.8 KB (added by , 15 years ago) |
---|
-
tests/regressiontests/generic_relations_regress/tests.py
70 70 Q(notes__note__icontains=r'other note')) 71 71 self.assertTrue(org_contact in qs) 72 72 73 74 73 def test_inherited_models_delete(self): 74 p = PersonWithComments.objects.create(account=23, name='Chef') 75 p.delete() 76 No newline at end of file -
tests/regressiontests/generic_relations_regress/models.py
1 1 from django.db import models 2 2 from django.contrib.contenttypes import generic 3 3 from django.contrib.contenttypes.models import ContentType 4 from django.contrib.comments.models import Comment 4 5 5 __all__ = ('Link', 'Place', 'Restaurant', 'Person', 'Address', 6 'CharLink', 'TextLink', 'OddRelation1', 'OddRelation2', 7 'Contact', 'Organization', 'Note' )6 __all__ = ('Link', 'Place', 'Restaurant', 'Person', 'Address', 7 'CharLink', 'TextLink', 'OddRelation1', 'OddRelation2', 8 'Contact', 'Organization', 'Note', 'PersonWithComments') 8 9 9 10 class Link(models.Model): 10 11 content_type = models.ForeignKey(ContentType) … … 77 78 name = models.CharField(max_length=255) 78 79 contacts = models.ManyToManyField(Contact, related_name='organizations') 79 80 81 class NewComment(Comment): 82 title = models.CharField(max_length=60) 83 84 class PersonWithComments(Person): 85 comments = generic.GenericRelation(NewComment, object_id_field='object_pk') 86