Kaydet (Commit) e1bbf3b6 authored tarafından Julien Phalip's avatar Julien Phalip

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
üst f0c22287
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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment