summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Phalip <jphalip@gmail.com>2012-02-19 16:53:55 +0000
committerJulien Phalip <jphalip@gmail.com>2012-02-19 16:53:55 +0000
commite1bbf3b6bc8a10cfea9c3101434b13d202637830 (patch)
tree858ca456a738550856cb2720fb1ec7b065749dca
parentf0c2228709b0481eac09c860d7a4a30d3987cc19 (diff)
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
-rw-r--r--django/contrib/admin/tests.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/contrib/admin/tests.py b/django/contrib/admin/tests.py
index 26618dce07..7c4aebeca3 100644
--- a/django/contrib/admin/tests.py
+++ b/django/contrib/admin/tests.py
@@ -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: