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:
Julien Phalip 2012-02-19 16:53:55 +00:00
parent f0c2228709
commit e1bbf3b6bc
1 changed files with 1 additions and 1 deletions

View File

@ -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: