summaryrefslogtreecommitdiff
path: root/tests/regressiontests/admin_views/tests.py
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2009-05-07 12:52:43 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2009-05-07 12:52:43 +0000
commitb5f0aff922fe963a4df0d3449d8fe55a6acd950d (patch)
tree41d25c3f89eb411e64569ce4e431f0a0f01dbfce /tests/regressiontests/admin_views/tests.py
parente5757f926156c644e92fee01a2bf05465ed13853 (diff)
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
Diffstat (limited to 'tests/regressiontests/admin_views/tests.py')
-rw-r--r--tests/regressiontests/admin_views/tests.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py
index a435003315..a571995d45 100644
--- a/tests/regressiontests/admin_views/tests.py
+++ b/tests/regressiontests/admin_views/tests.py
@@ -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',]