From 1c948e544e515e3d03db394d7f055ef1a05a10c2 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Sat, 3 Nov 2018 18:49:51 -0400 Subject: [PATCH] Refs #29883 -- Removed runtests.py's dependency on selenium. Regression in d207ac1568bb4dee305f6692ed7ddee8a1ff8b99. --- django/test/selenium.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/django/test/selenium.py b/django/test/selenium.py index 976f6ab06e..6e6badd933 100644 --- a/django/test/selenium.py +++ b/django/test/selenium.py @@ -2,9 +2,6 @@ import sys import unittest from contextlib import contextmanager -from selenium import webdriver -from selenium.webdriver.common.desired_capabilities import DesiredCapabilities - from django.test import LiveServerTestCase, tag from django.utils.decorators import classproperty from django.utils.module_loading import import_string @@ -67,10 +64,12 @@ class SeleniumTestCaseBase(type(LiveServerTestCase)): @classmethod def get_capability(cls, browser): + from selenium.webdriver.common.desired_capabilities import DesiredCapabilities return getattr(DesiredCapabilities, browser.upper()) def create_webdriver(self): if self.selenium_hub: + from selenium import webdriver return webdriver.Remote( command_executor=self.selenium_hub, desired_capabilities=self.get_capability(self.browser),