summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorHonza Král <Honza.Kral@gmail.com>2013-02-23 08:55:34 -0800
committerHonza Král <Honza.Kral@gmail.com>2013-02-23 08:55:34 -0800
commita05ab448f7a738d30ee7e8a513a65b6a67e8ea8e (patch)
tree5fe9dd5035a21929b52b67652c12005ef23a1433 /tests
parent335a060fa6a919fc5eb1ff22315f9b3ae44438b7 (diff)
parent1cd2f51eb43f9ed043982770b4efd5f28f53f302 (diff)
Merge pull request #781 from zsiciarz/ticket_19854
Fixed #19854 -- Added test runner option to skip Selenium tests
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/views/tests/i18n.py5
-rwxr-xr-xtests/runtests.py10
2 files changed, 14 insertions, 1 deletions
diff --git a/tests/regressiontests/views/tests/i18n.py b/tests/regressiontests/views/tests/i18n.py
index 0a091ed1b7..206cf3d256 100644
--- a/tests/regressiontests/views/tests/i18n.py
+++ b/tests/regressiontests/views/tests/i18n.py
@@ -2,6 +2,7 @@
from __future__ import absolute_import
import gettext
+import os
from os import path
from django.conf import settings
@@ -176,6 +177,10 @@ class JsI18NTestsMultiPackage(TestCase):
javascript_quote('este texto de app3 debe ser traducido'))
+skip_selenium = os.environ.get('DJANGO_SKIP_SELENIUM_TESTS', False)
+
+
+@unittest.skipIf(skip_selenium, 'Selenium tests skipped by explicit request')
@unittest.skipUnless(firefox, 'Selenium not installed')
class JavascriptI18nTests(LiveServerTestCase):
urls = 'regressiontests.views.urls'
diff --git a/tests/runtests.py b/tests/runtests.py
index c23737ed14..b9de137ea2 100755
--- a/tests/runtests.py
+++ b/tests/runtests.py
@@ -301,7 +301,12 @@ if __name__ == "__main__":
'--liveserver', action='store', dest='liveserver', default=None,
help='Overrides the default address where the live server (used with '
'LiveServerTestCase) is expected to run from. The default value '
- 'is localhost:8081.'),
+ 'is localhost:8081.')
+ parser.add_option(
+ '--skip-selenium', action='store_true', dest='skip_selenium',
+ default=False,
+ help='Skip running Selenium tests even it Selenium itself is '
+ 'installed. By default these tests are not skipped.')
options, args = parser.parse_args()
if options.settings:
os.environ['DJANGO_SETTINGS_MODULE'] = options.settings
@@ -314,6 +319,9 @@ if __name__ == "__main__":
if options.liveserver is not None:
os.environ['DJANGO_LIVE_TEST_SERVER_ADDRESS'] = options.liveserver
+ if options.skip_selenium:
+ os.environ['DJANGO_SKIP_SELENIUM_TESTS'] = '1'
+
if options.bisect:
bisect_tests(options.bisect, options, args)
elif options.pair: