|
19 | 19 | ExternalModel1, ExternalModel3, UnicodeVerboseName, HistoricalChoice,
|
20 | 20 | HistoricalState, HistoricalCustomFKError, Series, SeriesWork, PollInfo,
|
21 | 21 | UserAccessorDefault, UserAccessorOverride, Employee, Country, Province,
|
22 |
| - City, Contact, ContactRegister, Tracked |
| 22 | + City, Contact, ContactRegister, |
| 23 | + TrackedAbstractBaseA, TrackedAbstractBaseB, UntrackedAbstractBase, |
| 24 | + TrackedConcreteBase, UntrackedConcreteBase, |
23 | 25 | )
|
24 | 26 | from ..external.models import ExternalModel2, ExternalModel4
|
25 | 27 |
|
@@ -781,7 +783,52 @@ def test_custom_table_name_from_register(self):
|
781 | 783 | )
|
782 | 784 |
|
783 | 785 |
|
784 |
| -class TestAbstractHistoricalBaseModel(TestCase): |
| 786 | +class TestTrackingInheritance(TestCase): |
785 | 787 |
|
786 |
| - def test_historical_abstract(self): |
787 |
| - Tracked.history.all() |
| 788 | + def test_tracked_abstract_base(self): |
| 789 | + class TrackedWithAbstractBase(TrackedAbstractBaseA): |
| 790 | + pass |
| 791 | + |
| 792 | + TrackedWithAbstractBase.history.all() |
| 793 | + |
| 794 | + def test_tracked_concrete_base(self): |
| 795 | + class TrackedWithConcreteBase(TrackedConcreteBase): |
| 796 | + pass |
| 797 | + |
| 798 | + TrackedWithConcreteBase.history.all() |
| 799 | + |
| 800 | + def test_multiple_tracked_bases(self): |
| 801 | + with self.assertRaises(exceptions.MultipleRegistrationsError): |
| 802 | + class TrackedWithMultipleAbstractBases(TrackedAbstractBaseA, TrackedAbstractBaseB): |
| 803 | + pass |
| 804 | + |
| 805 | + def test_tracked_abstract_and_untracked_concrete_base(self): |
| 806 | + class TrackedWithTrackedAbstractAndUntrackedConcreteBase(TrackedAbstractBaseA, UntrackedConcreteBase): |
| 807 | + pass |
| 808 | + |
| 809 | + TrackedWithTrackedAbstractAndUntrackedConcreteBase.history.all() |
| 810 | + |
| 811 | + def test_indirect_tracked_abstract_base(self): |
| 812 | + class BaseTrackedWithIndirectTrackedAbstractBase(TrackedAbstractBaseA): |
| 813 | + pass |
| 814 | + |
| 815 | + class TrackedWithIndirectTrackedAbstractBase(BaseTrackedWithIndirectTrackedAbstractBase): |
| 816 | + pass |
| 817 | + |
| 818 | + TrackedWithIndirectTrackedAbstractBase.history.all() |
| 819 | + |
| 820 | + def test_indirect_tracked_concrete_base(self): |
| 821 | + class BaseTrackedWithIndirectTrackedConcreteBase(TrackedAbstractBaseA): |
| 822 | + pass |
| 823 | + |
| 824 | + class TrackedWithIndirectTrackedConcreteBase(BaseTrackedWithIndirectTrackedConcreteBase): |
| 825 | + pass |
| 826 | + |
| 827 | + TrackedWithIndirectTrackedConcreteBase.history.all() |
| 828 | + |
| 829 | + def test_registering_with_tracked_abstract_base(self): |
| 830 | + class TrackedWithAbstractBaseToRegister(TrackedAbstractBaseA): |
| 831 | + pass |
| 832 | + |
| 833 | + with self.assertRaises(exceptions.MultipleRegistrationsError): |
| 834 | + register(TrackedWithAbstractBaseToRegister) |
0 commit comments