Commits

Carl Meyer committed 79d1c42

Add tests for StatusField no_check_for_status.

Comments (0)

Files changed (1)

model_utils/tests/tests.py

 from django.test import TestCase
 
 from model_utils import Choices, ModelTracker
-from model_utils.fields import get_excerpt, MonitorField
+from model_utils.fields import get_excerpt, MonitorField, StatusField
 from model_utils.managers import QueryManager
 from model_utils.models import StatusModel, TimeFramedModel
 from model_utils.tests.models import (
         instance = StatusFieldDefaultNotFilled()
         self.assertEquals(instance.status, instance.STATUS.no)
 
+    def test_no_check_for_status(self):
+        field = StatusField(no_check_for_status=True)
+        # this model has no STATUS attribute, so checking for it would error
+        field.prepare_class(Article)
+
 
 class ChoicesTests(TestCase):
     def setUp(self):
                               NoRendered._meta.get_field,
                               '_body_excerpt')
 
+        def test_status_field_no_check_for_status(self):
+            sf = StatusFieldDefaultFilled._meta.get_field('status')
+            args, kwargs = introspector(sf)
+            self.assertEqual(kwargs['no_check_for_status'], 'True')
+
 
 
 class PassThroughManagerTests(TestCase):