mirror of
https://github.com/Hopiu/django-model-utils.git
synced 2026-03-16 20:00:23 +00:00
Add test for ModelTracker descriptor on class
This commit is contained in:
parent
33f42ab80a
commit
cf153f3c06
1 changed files with 4 additions and 1 deletions
|
|
@ -9,7 +9,7 @@ from django.db.models.fields import FieldDoesNotExist
|
|||
from django.core.exceptions import ImproperlyConfigured, FieldError
|
||||
from django.test import TestCase
|
||||
|
||||
from model_utils import Choices
|
||||
from model_utils import Choices, ModelTracker
|
||||
from model_utils.fields import get_excerpt, MonitorField
|
||||
from model_utils.managers import QueryManager
|
||||
from model_utils.models import StatusModel, TimeFramedModel
|
||||
|
|
@ -686,6 +686,9 @@ class ModelTrackerTests(ModelTrackerTestCase, ModelTrackerCommonTests):
|
|||
self.instance = Tracked()
|
||||
self.tracker = self.instance.tracker
|
||||
|
||||
def test_descriptor(self):
|
||||
self.assertTrue(isinstance(Tracked.tracker, ModelTracker))
|
||||
|
||||
def test_post_save_has_changed(self):
|
||||
self.update_instance(name='retro', number=4)
|
||||
self.assertHasChanged(name=False, number=False)
|
||||
|
|
|
|||
Loading…
Reference in a new issue