mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #10516 -- Corrected admin search when the search_fields definition contains multiple fields on the same base model. Thanks to Zain Memon for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10684 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -890,6 +890,21 @@ class AdminViewListEditable(TestCase):
|
||||
|
||||
self.failUnlessEqual(Person.objects.get(name="John Mauchly").alive, False)
|
||||
|
||||
class AdminSearchTest(TestCase):
|
||||
fixtures = ['admin-views-users','multiple-child-classes']
|
||||
|
||||
def setUp(self):
|
||||
self.client.login(username='super', password='secret')
|
||||
|
||||
def tearDown(self):
|
||||
self.client.logout()
|
||||
|
||||
def test_search_on_sibling_models(self):
|
||||
"Check that a search that mentions sibling models"
|
||||
response = self.client.get('/test_admin/admin/admin_views/recommendation/?q=bar')
|
||||
# confirm the search returned 1 object
|
||||
self.assertContains(response, "\n1 recommendation\n")
|
||||
|
||||
class AdminInheritedInlinesTest(TestCase):
|
||||
fixtures = ['admin-views-users.xml',]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user