Skip to content

Commit e3c844c

Browse files
author
Ross Mechanic
committed
Fixed issue with accidentally removing import
1 parent 086fdc4 commit e3c844c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

simple_history/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def finalize(self, sender, **kwargs):
9292
)
9393
history_model = self.create_history_model(sender, inherited)
9494
if inherited:
95-
# Make sure history model is in same module as inherited class
95+
# Make sure history model is in same module as concrete model
9696
module = importlib.import_module(history_model.__module__)
9797
else:
9898
module = importlib.import_module(self.module)

simple_history/tests/tests/test_models.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
import warnings
55
from datetime import datetime, timedelta
66

7-
import django
7+
from django.apps import apps
88
from django.contrib.auth import get_user_model
99
from django.core.files.base import ContentFile
1010
from django.db import models
1111
from django.db.models.fields.proxy import OrderWrt
1212
from django.test import TestCase
13+
1314
from simple_history.models import HistoricalRecords, convert_auto_field
1415
from simple_history.utils import update_change_reason
15-
1616
from ..external.models import ExternalModel2, ExternalModel4
1717
from ..models import (AbstractBase, AdminProfile, Book, Bookcase, Choice, City,
1818
ConcreteAttr, ConcreteExternal, ConcreteUtil, Contact, ContactRegister,
@@ -395,6 +395,10 @@ def test_register_app_label(self):
395395
'external_externalmodel4')
396396
self.assertEqual(self.get_table_name(ExternalModel4.histories),
397397
'tests_historicalexternalmodel4')
398+
self.assertEqual(self.get_table_name(ConcreteExternal.objects),
399+
'tests_concreteexternal')
400+
self.assertEqual(self.get_table_name(ConcreteExternal.history),
401+
'tests_historicalconcreteexternal')
398402

399403
def test_get_model(self):
400404
self.assertEqual(get_model('external', 'ExternalModel1'),

0 commit comments

Comments
 (0)