Ticket #19963: validation-of-date_hierarchy-across-relation-failing-test.diff

File validation-of-date_hierarchy-across-relation-failing-test.diff, 959 bytes (added by Aymeric Augustin, 12 years ago)
  • tests/modeladmin/tests.py

    diff --git a/tests/modeladmin/tests.py b/tests/modeladmin/tests.py
    index e5450ab..0a77257 100644
    a b class ValidationTests(unittest.TestCase):  
    11841184
    11851185        validate(ValidationTestModelAdmin, ValidationTestModel)
    11861186
     1187        class ValidationTestModelAdmin(ModelAdmin):
     1188            date_hierarchy = 'parent__name'
     1189
     1190        six.assertRaisesRegex(self,
     1191            ImproperlyConfigured,
     1192            "'ValidationTestModelAdmin.parent__name is neither an instance of DateField nor DateTimeField.",
     1193            validate,
     1194            ValidationTestModelAdmin,
     1195            ValidationTestModel,
     1196        )
     1197
     1198        class ValidationTestModelAdmin(ModelAdmin):
     1199            date_hierarchy = 'parent__pub_date'
     1200
     1201        validate(ValidationTestModelAdmin, ValidationTestInlineModel)
     1202
    11871203    def test_ordering_validation(self):
    11881204
    11891205        class ValidationTestModelAdmin(ModelAdmin):
Back to Top