Skip to content

Commit

Permalink
Make headless tests configurable via setting
Browse files Browse the repository at this point in the history
  • Loading branch information
anrie committed Apr 3, 2015
1 parent fd1e3bf commit 0a22b61
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions example/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,4 @@
IMAGE_CROPPING_THUMB_SIZE = (300, 300)
IMAGE_CROPPING_JQUERY_URL = 'js/jquery.min.js'
THUMBNAIL_DEBUG = True
HEADLESS = False
8 changes: 5 additions & 3 deletions example/tests/test_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@ class BrowserTestBase(object):

@classmethod
def setUpClass(cls):
cls.display = Display(visible=0, size=(1024, 768))
cls.display.start()
if settings.HEADLESS:
cls.display = Display(visible=0, size=(1024, 768))
cls.display.start()
cls.selenium = WebDriver()
super(BrowserTestBase, cls).setUpClass()

@classmethod
def tearDownClass(cls):
cls.selenium.quit()
cls.display.stop()
if settings.HEADLESS:
cls.display.stop()
super(BrowserTestBase, cls).tearDownClass()

def setUp(self):
Expand Down

0 comments on commit 0a22b61

Please sign in to comment.