20
20
HistoricalState , HistoricalCustomFKError , Series , SeriesWork , PollInfo ,
21
21
UserAccessorDefault , UserAccessorOverride , Employee , Country , Province ,
22
22
City , Contact , ContactRegister ,
23
- TrackedAbstractBaseA , TrackedAbstractBaseB , UntrackedAbstractBase ,
24
- TrackedConcreteBase , UntrackedConcreteBase ,
23
+ TrackedAbstractBaseA , TrackedAbstractBaseB ,
24
+ TrackedWithAbstractBase , TrackedWithConcreteBase ,
25
+ TrackedWithTrackedAbstractAndUntrackedConcreteBase ,
26
+ TrackedWithIndirectTrackedAbstractBase ,
27
+ TrackedWithIndirectTrackedConcreteBase ,
28
+ TrackedWithAbstractBaseToRegister ,
25
29
)
26
30
from ..external .models import ExternalModel2 , ExternalModel4
27
31
@@ -786,18 +790,12 @@ def test_custom_table_name_from_register(self):
786
790
class TestTrackingInheritance (TestCase ):
787
791
788
792
def test_tracked_abstract_base (self ):
789
- class TrackedWithAbstractBase (TrackedAbstractBaseA ):
790
- pass
791
-
792
793
self .assertEqual (
793
794
[f .attname for f in TrackedWithAbstractBase .history .model ._meta .fields ],
794
795
['id' , 'history_id' , 'history_date' , 'history_user_id' , 'history_type' ],
795
796
)
796
797
797
798
def test_tracked_concrete_base (self ):
798
- class TrackedWithConcreteBase (TrackedConcreteBase ):
799
- pass
800
-
801
799
self .assertEqual (
802
800
[f .attname for f in TrackedWithConcreteBase .history .model ._meta .fields ],
803
801
['id' , 'trackedconcretebase_ptr_id' , 'history_id' , 'history_date' , 'history_user_id' , 'history_type' ],
@@ -809,21 +807,12 @@ class TrackedWithMultipleAbstractBases(TrackedAbstractBaseA, TrackedAbstractBase
809
807
pass
810
808
811
809
def test_tracked_abstract_and_untracked_concrete_base (self ):
812
- class TrackedWithTrackedAbstractAndUntrackedConcreteBase (TrackedAbstractBaseA , UntrackedConcreteBase ):
813
- pass
814
-
815
810
self .assertEqual (
816
811
[f .attname for f in TrackedWithTrackedAbstractAndUntrackedConcreteBase .history .model ._meta .fields ],
817
812
['id' , 'untrackedconcretebase_ptr_id' , 'history_id' , 'history_date' , 'history_user_id' , 'history_type' ],
818
813
)
819
814
820
815
def test_indirect_tracked_abstract_base (self ):
821
- class BaseTrackedWithIndirectTrackedAbstractBase (TrackedAbstractBaseA ):
822
- pass
823
-
824
- class TrackedWithIndirectTrackedAbstractBase (BaseTrackedWithIndirectTrackedAbstractBase ):
825
- pass
826
-
827
816
self .assertEqual (
828
817
[f .attname for f in TrackedWithIndirectTrackedAbstractBase .history .model ._meta .fields ],
829
818
[
@@ -832,12 +821,6 @@ class TrackedWithIndirectTrackedAbstractBase(BaseTrackedWithIndirectTrackedAbstr
832
821
)
833
822
834
823
def test_indirect_tracked_concrete_base (self ):
835
- class BaseTrackedWithIndirectTrackedConcreteBase (TrackedAbstractBaseA ):
836
- pass
837
-
838
- class TrackedWithIndirectTrackedConcreteBase (BaseTrackedWithIndirectTrackedConcreteBase ):
839
- pass
840
-
841
824
self .assertEqual (
842
825
[f .attname for f in TrackedWithIndirectTrackedConcreteBase .history .model ._meta .fields ],
843
826
[
@@ -846,8 +829,5 @@ class TrackedWithIndirectTrackedConcreteBase(BaseTrackedWithIndirectTrackedConcr
846
829
)
847
830
848
831
def test_registering_with_tracked_abstract_base (self ):
849
- class TrackedWithAbstractBaseToRegister (TrackedAbstractBaseA ):
850
- pass
851
-
852
832
with self .assertRaises (exceptions .MultipleRegistrationsError ):
853
833
register (TrackedWithAbstractBaseToRegister )
0 commit comments