Skip to content

Commit

Permalink
test: don't search for source strings when testing a translation
Browse files Browse the repository at this point in the history
  • Loading branch information
cfm committed Nov 21, 2024
1 parent c608b28 commit 0d31f8c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def explanatory_tooltip_is_correct() -> None:
explanatory_tooltip_opacity = explanatory_tooltip.value_of_css_property("opacity")
assert explanatory_tooltip_opacity == "1"

if assert_tooltip_text_is:
if assert_tooltip_text_is and not journ_app_nav.accept_languages:
assert explanatory_tooltip.text == assert_tooltip_text_is

journ_app_nav.nav_helper.wait_for(explanatory_tooltip_is_correct)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,8 @@ def test_ossec_alert_button(self, sd_servers, firefox_web_driver):
# Then it succeeds
def test_alert_sent():
flash_msg = journ_app_nav.driver.find_element(By.CSS_SELECTOR, ".flash")
assert "Test alert sent. Please check your email." in flash_msg.text
if not journ_app_nav.accept_languages:
assert "Test alert sent. Please check your email." in flash_msg.text

journ_app_nav.nav_helper.wait_for(test_alert_sent)

Expand Down
2 changes: 1 addition & 1 deletion securedrop/tests/functional/web_drivers.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def _create_firefox_driver(

# Add this attribute to the returned driver object so that tests using this
# fixture can know what locale it's parameterized with.
firefox_driver.locale = accept_languages or "en_US" # type: ignore[attr-defined]
firefox_driver.locale = accept_languages # type: ignore[attr-defined]

return firefox_driver

Expand Down

0 comments on commit 0d31f8c

Please sign in to comment.