|
15 | 15 |
|
16 | 16 | from ..external.models import ExternalModel2, ExternalModel4
|
17 | 17 | from ..models import (AbstractBase, AdminProfile, Book, Bookcase, Choice, City,
|
18 |
| - ConcreteAttr, ConcreteUtil, Contact, ContactRegister, |
| 18 | + ConcreteAttr, ConcreteExternal, ConcreteUtil, Contact, ContactRegister, |
19 | 19 | Country, Document, Employee, ExternalModel1,
|
20 | 20 | ExternalModel3, FileModel, HistoricalChoice,
|
21 | 21 | HistoricalCustomFKError, HistoricalPoll, HistoricalState,
|
22 | 22 | Library, MultiOneToOne, Person, Poll, PollInfo,
|
23 | 23 | PollWithExcludeFields, Province, Restaurant, SelfFK,
|
24 | 24 | Series, SeriesWork, State, Temperature,
|
25 | 25 | UnicodeVerboseName, WaterLevel)
|
26 |
| -from django.apps import apps |
27 | 26 |
|
28 | 27 | get_model = apps.get_model
|
29 | 28 | User = get_user_model()
|
@@ -418,6 +417,13 @@ def test_get_model(self):
|
418 | 417 | self.assertEqual(get_model('tests', 'HistoricalExternalModel4'),
|
419 | 418 | ExternalModel4.histories.model)
|
420 | 419 |
|
| 420 | + # Test that historical model is defined within app of concrete |
| 421 | + # model rather than abstract base model |
| 422 | + self.assertEqual(get_model('tests', 'ConcreteExternal'), |
| 423 | + ConcreteExternal) |
| 424 | + self.assertEqual(get_model('tests', 'HistoricalConcreteExternal'), |
| 425 | + ConcreteExternal.history.model) |
| 426 | + |
421 | 427 |
|
422 | 428 | class HistoryManagerTest(TestCase):
|
423 | 429 | def test_most_recent(self):
|
|
0 commit comments