diff --git a/docs/contributing.rst b/docs/contributing.rst index 55d9a5ca7..0021a88fa 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -85,6 +85,12 @@ or by setting the ``DJANGO_SELENIUM_TESTS`` environment variable:: $ DJANGO_SELENIUM_TESTS=true make coverage $ DJANGO_SELENIUM_TESTS=true tox +Note that by default, ``tox`` enables the Selenium tests for a single test +environment. To run the entire ``tox`` test suite with all Selenium tests +disabled, run the following:: + + $ DJANGO_SELENIUM_TESTS= tox + To test via ``tox`` against other databases, you'll need to create the user, database and assign the proper permissions. For PostgreSQL in a ``psql`` shell (note this allows the debug_toolbar user the permission to create diff --git a/tests/test_integration.py b/tests/test_integration.py index fee67b7d1..127406df8 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -547,7 +547,7 @@ def test_auth_login_view_without_redirect(self): @unittest.skipIf(webdriver is None, "selenium isn't installed") @unittest.skipUnless( - "DJANGO_SELENIUM_TESTS" in os.environ, "selenium tests not requested" + os.environ.get("DJANGO_SELENIUM_TESTS"), "selenium tests not requested" ) @override_settings(DEBUG=True) class DebugToolbarLiveTestCase(StaticLiveServerTestCase): diff --git a/tox.ini b/tox.ini index 4910a9f6b..a0e72827a 100644 --- a/tox.ini +++ b/tox.ini @@ -36,7 +36,7 @@ passenv= setenv = PYTHONPATH = {toxinidir} PYTHONWARNINGS = d - py311-dj42-postgresql: DJANGO_SELENIUM_TESTS = true + py311-dj42-postgresql: DJANGO_SELENIUM_TESTS = {env:DJANGO_SELENIUM_TESTS:true} DB_NAME = {env:DB_NAME:debug_toolbar} DB_USER = {env:DB_USER:debug_toolbar} DB_HOST = {env:DB_HOST:localhost}