Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OIDC scopes related tests fail because of mismatch between "Sähköposti" and "Sähköpostiosoite" texts #268

Open
karisal-anders opened this issue Feb 17, 2023 · 0 comments

Comments

@karisal-anders
Copy link

Steps how to reproduce issue:

  • git clone https://github.com/City-of-Helsinki/tunnistamo.git testing-tunnistamo
  • cd testing-tunnistamo
  • git checkout dbb0795e7f7e2bae5d9e93682c88e8e9ed9d35a1 (This is the most recent commit in develop branch on 2023-02-17)
  • cp docker-compose.env.yaml.template docker-compose.env.yaml
  • docker-compose up
  • docker-compose exec django bash
    • pytest . -vv
============================================================================================ short test summary info =============================================================================================
FAILED scopes/tests/test_api.py::test_get_oidc_scopes_list - AssertionError: assert {'fi': 'Sähköposti', 'en': 'Email', 'sv': 'E-postadress'} == {'fi': 'Sähköpostiosoite', 'sv': 'E-postadress', 'en': 'Email'}
FAILED users/tests/test_user_consent_api.py::test_get[True-list] - AssertionError: assert {'fi': 'Sähköposti', 'en': 'Email', 'sv': 'E-postadress'} == {'fi': 'Sähköpostiosoite', 'sv': 'E-postadress', 'en': 'Email'}
FAILED users/tests/test_user_consent_api.py::test_get[True-detail] - AssertionError: assert {'fi': 'Sähköposti', 'en': 'Email', 'sv': 'E-postadress'} == {'fi': 'Sähköpostiosoite', 'sv': 'E-postadress', 'en': 'Email'}
============================================================================ 3 failed, 489 passed, 1022 warnings in 184.80s (0:03:04) ============================================================================

Full log of the pytest . -vv:

Possible fix:

diff --git a/scopes/tests/test_api.py b/scopes/tests/test_api.py
index 58078fc..6dbf763 100644
--- a/scopes/tests/test_api.py
+++ b/scopes/tests/test_api.py
@@ -44,7 +44,7 @@ def test_get_oidc_scopes_list(api_client):
     assert [s['id'] for s in results] == EXPECTED_OIDC_SCOPES
     email_scope_data = next(s for s in results if s['id'] == 'email')
     assert email_scope_data.keys() == {'id', 'name', 'description'}
-    assert email_scope_data['name'] == {'fi': 'Sähköpostiosoite', 'sv': 'E-postadress', 'en': 'Email'}
+    assert email_scope_data['name'] == {'fi': 'Sähköposti', 'sv': 'E-postadress', 'en': 'Email'}
 
 
 def test_get_also_api_scopes_list(api_client):
diff --git a/users/tests/test_user_consent_api.py b/users/tests/test_user_consent_api.py
index e791e34..6c068fe 100644
--- a/users/tests/test_user_consent_api.py
+++ b/users/tests/test_user_consent_api.py
@@ -79,7 +79,7 @@ def test_get(user_api_client, endpoint, scope_included, service):
 
         assert oidc_scope.keys() == {'id', 'name', 'description'}
         assert oidc_scope['id'] == 'email'
-        assert oidc_scope['name'] == {'fi': 'Sähköpostiosoite', 'sv': 'E-postadress', 'en': 'Email'}
+        assert oidc_scope['name'] == {'fi': 'Sähköposti', 'sv': 'E-postadress', 'en': 'Email'}
         assert 'en' in oidc_scope['description']
 
         assert api_scope.keys() == {'id', 'name', 'description'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant