diff --git a/tests/regressiontests/delete_regress/models.py b/tests/regressiontests/delete_regress/models.py
index 8109c0a..77330ec 100644
a
|
b
|
class PlayedWith(models.Model):
|
35 | 35 | class PlayedWithNote(models.Model): |
36 | 36 | played = models.ForeignKey(PlayedWith) |
37 | 37 | note = models.TextField() |
| 38 | |
| 39 | |
| 40 | class Contact(models.Model): |
| 41 | label = models.CharField(max_length=100) |
| 42 | |
| 43 | class Email(Contact): |
| 44 | email_address = models.EmailField(max_length=100) |
| 45 | |
| 46 | class Researcher(Contact): |
| 47 | contacts = models.ManyToManyField(Contact, related_name="research_contacts") |
diff --git a/tests/regressiontests/delete_regress/tests.py b/tests/regressiontests/delete_regress/tests.py
index 754031b..6c7984c 100644
a
|
b
|
from django.conf import settings
|
4 | 4 | from django.db import backend, connection, transaction, DEFAULT_DB_ALIAS |
5 | 5 | from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature |
6 | 6 | |
7 | | from models import Book, Award, AwardNote, Person, Child, Toy, PlayedWith, PlayedWithNote |
| 7 | from models import (Book, Award, AwardNote, Person, Child, Toy, PlayedWith, |
| 8 | PlayedWithNote, Contact, Email, Researcher) |
8 | 9 | |
9 | 10 | |
10 | 11 | # Can't run this test under SQLite, because you can't |
… |
… |
class DeleteCascadeTests(TestCase):
|
108 | 109 | # first two asserts just sanity checks, this is the kicker: |
109 | 110 | self.assertEquals(PlayedWithNote.objects.count(), 0) |
110 | 111 | |
| 112 | def test_inheritance(self): |
| 113 | r = Researcher.objects.create(label="Carl") |
| 114 | email = Email.objects.create( |
| 115 | label="office-email", email_address="carl@science.edu" |
| 116 | ) |
| 117 | r.contacts.add(email) |
| 118 | |
| 119 | email.delete() |
| 120 | |
111 | 121 | class LargeDeleteTests(TestCase): |
112 | 122 | def test_large_deletes(self): |
113 | 123 | "Regression for #13309 -- if the number of objects > chunk size, deletion still occurs" |