1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Ensure that NullBooleanField displays the appropriate icon for null values in admin changelists. Refs #13071.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12746 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
James Bennett
2010-03-10 08:37:17 +00:00
parent baa4d3b710
commit a0c77ada99
4 changed files with 20 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
from datetime import datetime
import unittest
from django.conf import settings
from django.db import models
from django.utils.formats import localize
from django.test import TestCase
@@ -131,8 +132,11 @@ class UtilTests(unittest.TestCase):
display_value = display_for_field(None, models.TimeField())
self.assertEqual(display_value, EMPTY_CHANGELIST_VALUE)
# Regression test for #13071: NullBooleanField has special
# handling.
display_value = display_for_field(None, models.NullBooleanField())
self.assertEqual(display_value, EMPTY_CHANGELIST_VALUE)
expected = u'<img src="%simg/admin/icon-unknown.gif" alt="None" />' % settings.ADMIN_MEDIA_PREFIX
self.assertEqual(display_value, expected)
display_value = display_for_field(None, models.DecimalField())
self.assertEqual(display_value, EMPTY_CHANGELIST_VALUE)