Skip to content

Commit

Permalink
Fixed #19051 - Fixed Selenium tearDownClass method; thanks glarrain f…
Browse files Browse the repository at this point in the history
…or the report.
  • Loading branch information
timgraham committed Oct 4, 2012
1 parent 7251282 commit a1a5c08
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions django/contrib/admin/tests.py
Expand Up @@ -21,9 +21,9 @@ def setUpClass(cls):

@classmethod
def tearDownClass(cls):
super(AdminSeleniumWebDriverTestCase, cls).tearDownClass()
if hasattr(cls, 'selenium'):
cls.selenium.quit()
super(AdminSeleniumWebDriverTestCase, cls).tearDownClass()

def wait_until(self, callback, timeout=10):
"""
Expand Down Expand Up @@ -98,4 +98,4 @@ def has_css_class(self, selector, klass):
`klass`.
"""
return (self.selenium.find_element_by_css_selector(selector)
.get_attribute('class').find(klass) != -1)
.get_attribute('class').find(klass) != -1)
2 changes: 1 addition & 1 deletion docs/topics/testing.txt
Expand Up @@ -1973,8 +1973,8 @@ Then, add a ``LiveServerTestCase``-based test to your app's tests module

@classmethod
def tearDownClass(cls):
super(MySeleniumTests, cls).tearDownClass()
cls.selenium.quit()
super(MySeleniumTests, cls).tearDownClass()

def test_login(self):
self.selenium.get('%s%s' % (self.live_server_url, '/login/'))
Expand Down

0 comments on commit a1a5c08

Please sign in to comment.