Skip to content

Commit

Permalink
fix(firefox_web_driver): configure Firefox's locale at fixture time
Browse files Browse the repository at this point in the history
Otherwise the fixture isn't set up to request the language expected by
the tests that use it.
  • Loading branch information
cfm committed Oct 7, 2024
1 parent 4db4bd7 commit 7edff79
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion securedrop/tests/functional/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,18 @@
from source_user import SourceUser
from tests.factories import SecureDropConfigFactory
from tests.functional.db_session import get_database_session
from tests.functional.pageslayout.utils import list_locales
from tests.functional.web_drivers import WebDriverTypeEnum, get_web_driver
from tests.utils.i18n import get_test_locales


# Function-scoped so that tests can be run in parallel if needed
@pytest.fixture
def firefox_web_driver() -> WebDriver: # type: ignore
with get_web_driver(web_driver_type=WebDriverTypeEnum.FIREFOX) as web_driver:
with get_web_driver(
web_driver_type=WebDriverTypeEnum.FIREFOX,
accept_languages=",".join(list_locales()).replace("_", "-"),
) as web_driver:
yield web_driver


Expand Down

0 comments on commit 7edff79

Please sign in to comment.