mirror of
https://github.com/django/django.git
synced 2024-12-24 10:05:46 +00:00
Moved an import statement to handle the case where selenium isn't installed.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17563 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
f0c2228709
commit
e1bbf3b6bc
@ -1,5 +1,4 @@
|
||||
import sys
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
|
||||
from django.test import LiveServerTestCase
|
||||
from django.utils.importlib import import_module
|
||||
@ -79,6 +78,7 @@ class AdminSeleniumWebDriverTestCase(LiveServerTestCase):
|
||||
Helper function to select the <OPTION> that has the value `value` and
|
||||
that is in the <SELECT> widget identified by the CSS selector `selector`.
|
||||
"""
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
options = self.selenium.find_elements_by_css_selector('%s option' % selector)
|
||||
for option in options:
|
||||
if option.get_attribute('value') == value:
|
||||
|
Loading…
Reference in New Issue
Block a user