diff --git a/django/contrib/admin/views/main.py b/django/contrib/admin/views/main.py
index df0fd9f..d34bb1b 100644
a
|
b
|
class ChangeList(object):
|
185 | 185 | if key.endswith('__in'): |
186 | 186 | lookup_params[key] = value.split(',') |
187 | 187 | |
| 188 | # if key ends with __isnull, special case '' and false |
| 189 | if key.endswith('__isnull'): |
| 190 | if value.lower() in ('', 'false'): |
| 191 | lookup_params[key] = False |
| 192 | else: |
| 193 | lookup_params[key] = True |
| 194 | |
188 | 195 | # Apply lookup parameters from the query string. |
189 | 196 | try: |
190 | 197 | qs = qs.filter(**lookup_params) |
diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py
index 3124071..dfabe21 100644
a
|
b
|
class AdminViewBasicTest(TestCase):
|
65 | 65 | |
66 | 66 | def testBasicEditGet(self): |
67 | 67 | """ |
68 | | A smoke test to ensureGET on the change_view works. |
| 68 | A smoke test to ensure GET on the change_view works. |
69 | 69 | """ |
70 | 70 | response = self.client.get('/test_admin/%s/admin_views/section/1/' % self.urlbit) |
71 | 71 | self.failUnlessEqual(response.status_code, 200) |
… |
… |
class AdminViewBasicTest(TestCase):
|
205 | 205 | response = self.client.get('/test_admin/%s/admin_views/thing/' % self.urlbit, {'color__id__exact': 'StringNotInteger!'}) |
206 | 206 | self.assertRedirects(response, '/test_admin/%s/admin_views/thing/?e=1' % self.urlbit) |
207 | 207 | |
| 208 | def testIsNullLookups(self): |
| 209 | """Ensure is_null is handled correctly.""" |
| 210 | response = self.client.get('/test_admin/%s/admin_views/article/' % self.urlbit) |
| 211 | self.assertTrue('3 articles' in response.content, '"3 articles" missing from response') |
| 212 | response = self.client.get('/test_admin/%s/admin_views/article/' % self.urlbit, {'section__isnull': 'false'}) |
| 213 | self.assertTrue('3 articles' in response.content, '"3 articles" missing from response') |
| 214 | response = self.client.get('/test_admin/%s/admin_views/article/' % self.urlbit, {'section__isnull': 'true'}) |
| 215 | self.assertTrue('0 articles' in response.content, '"0 articles" missing from response') |
| 216 | |
208 | 217 | def testLogoutAndPasswordChangeURLs(self): |
209 | 218 | response = self.client.get('/test_admin/%s/admin_views/article/' % self.urlbit) |
210 | 219 | self.failIf('<a href="/test_admin/%s/logout/">' % self.urlbit not in response.content) |