diff --git a/django/contrib/admin/tests.py b/django/contrib/admin/tests.py index 9ad817d4a7..2491fc65b1 100644 --- a/django/contrib/admin/tests.py +++ b/django/contrib/admin/tests.py @@ -79,7 +79,7 @@ class AdminSeleniumWebDriverTestCase(LiveServerTestCase): identified by the CSS selector `selector`. """ from selenium.common.exceptions import NoSuchElementException - options = self.selenium.find_elements_by_css_selector('%s option' % selector) + options = self.selenium.find_elements_by_css_selector('%s > option' % selector) for option in options: if option.get_attribute('value') == value: return option @@ -90,7 +90,7 @@ class AdminSeleniumWebDriverTestCase(LiveServerTestCase): Asserts that the