- If you’re having trouble with the button above, copy and paste the URL below into your web browser.
+ If you're having trouble with the button above, copy and paste the URL below into your web browser.
http://localhost/account-confirmation?token=xxx
|
@@ -119,9 +120,7 @@ expected_fr_html_body = """
Bonjour test,
- Vous avez créé un compte sur FitTrackee.
- Cliquez sur le lien ci-dessous pour confirmer votre adresse email.
-
+ Vous avez créé un compte sur FitTrackee. Cliquez sur le bouton pour confirmer votre adresse email.
@@ -144,7 +143,7 @@ expected_fr_html_body = """
- Si vous avez des problèmes avec le bouton, vous pouvez copier et coller le lien suivant dans votre navigateur
+ Si vous avez des problèmes avec le bouton, vous pouvez copier et coller le lien suivant dans votre navigateur.
http://localhost/account-confirmation?token=xxx
|
diff --git a/fittrackee/tests/emails/template_results/email_update_to_current_email.py b/fittrackee/tests/emails/template_results/email_update_to_current_email.py
index 1d0a3dba..3f9f0153 100644
--- a/fittrackee/tests/emails/template_results/email_update_to_current_email.py
+++ b/fittrackee/tests/emails/template_results/email_update_to_current_email.py
@@ -42,7 +42,7 @@ expected_en_html_body = """
Hi test,
- You recently requested to change your email address for your FitTrackee account to:
+ You recently requested to change your email address for your FitTrackee account to:
@@ -61,9 +61,8 @@ expected_en_html_body = """
If this email change wasn't initiated by you, please change your password immediately or contact your administrator if your account is locked.
Thanks,
-
- The FitTrackee Team
-
+ The FitTrackee Team
+
|
@@ -127,9 +126,8 @@ expected_fr_html_body = """
Si vous n'êtes pas à l'origine de cette modification, veuillez changer votre mot de passe immédiatement ou contacter l'administrateur si votre compte est bloqué.
Merci,
-
- L'équipe FitTrackee
-
+ L'équipe FitTrackee
+
diff --git a/fittrackee/tests/emails/template_results/email_update_to_new_email.py b/fittrackee/tests/emails/template_results/email_update_to_new_email.py
index 5a3f6dbb..dd0b0878 100644
--- a/fittrackee/tests/emails/template_results/email_update_to_new_email.py
+++ b/fittrackee/tests/emails/template_results/email_update_to_new_email.py
@@ -2,7 +2,8 @@
expected_en_text_body = """Hi test,
-You recently requested to change your email address for your FitTrackee account. Use the link below to confirm this address.
+You recently requested to change your email address for your FitTrackee account.
+Use the link below to confirm this address.
Verify your email: http://localhost/email-update?token=xxx
@@ -15,7 +16,8 @@ http://localhost"""
expected_en_text_body_without_security = """Hi test,
-You recently requested to change your email address for your FitTrackee account. Use the link below to confirm this address.
+You recently requested to change your email address for your FitTrackee account.
+Use the link below to confirm this address.
Verify your email: http://localhost/email-update?token=xxx
@@ -30,7 +32,7 @@ expected_fr_text_body = """Bonjour test,
Vous avez récemment demandé la modification de l'adresse email associée à votre compte sur FitTrackee.
Cliquez sur le lien ci-dessous pour confirmer cette adresse email.
-Vérifier l'adresse email : http://localhost/email-update?token=xxx
+Vérifier l'adresse email: http://localhost/email-update?token=xxx
Pour vérification, cette demande a été reçue à partir d'un appareil sous Linux, utilisant le navigateur Firefox.
Si vous n'êtes pas à l'origine de cette modification, vous pouvez ignorer cet e-mail.
@@ -44,7 +46,7 @@ expected_fr_text_body_without_security = """Bonjour test,
Vous avez récemment demandé la modification de l'adresse email associée à votre compte sur FitTrackee.
Cliquez sur le lien ci-dessous pour confirmer cette adresse email.
-Vérifier l'adresse email : http://localhost/email-update?token=xxx
+Vérifier l'adresse email: http://localhost/email-update?token=xxx
Si vous n'êtes pas à l'origine de cette modification, vous pouvez ignorer cet e-mail.
@@ -95,7 +97,7 @@ expected_en_html_body = """
- If you’re having trouble with the button above, copy and paste the URL below into your web browser.
+ If you're having trouble with the button above, copy and paste the URL below into your web browser.
http://localhost/email-update?token=xxx
|
@@ -166,7 +168,7 @@ expected_en_html_body_without_security = """
- If you’re having trouble with the button above, copy and paste the URL below into your web browser.
+ If you're having trouble with the button above, copy and paste the URL below into your web browser.
http://localhost/email-update?token=xxx
|
@@ -196,7 +198,7 @@ expected_en_html_body_without_security = """
"""
expected_fr_html_body = """
-
+
@@ -215,9 +217,7 @@ expected_fr_html_body = """
|
Bonjour test,
- Vous avez récemment demandé la modification de l'adresse email associée à votre compte sur FitTrackee.
- Cliquez sur le bouton ci-dessous pour confirmer cette adresse email.
-
+ Vous avez récemment demandé la modification de l'adresse email associée à votre compte sur FitTrackee. Cliquez sur le bouton ci-dessous pour confirmer cette adresse email.
@@ -240,7 +240,7 @@ expected_fr_html_body = """
- Si vous avez des problèmes avec le bouton, vous pouvez copier et coller le lien suivant dans votre navigateur
+ Si vous avez des problèmes avec le bouton, vous pouvez copier et coller le lien suivant dans votre navigateur.
http://localhost/email-update?token=xxx
|
@@ -270,7 +270,7 @@ expected_fr_html_body = """
"""
expected_fr_html_body_without_security = """
-
+
@@ -289,9 +289,7 @@ expected_fr_html_body_without_security = """
|
Bonjour test,
- Vous avez récemment demandé la modification de l'adresse email associée à votre compte sur FitTrackee.
- Cliquez sur le bouton ci-dessous pour confirmer cette adresse email.
-
+ Vous avez récemment demandé la modification de l'adresse email associée à votre compte sur FitTrackee. Cliquez sur le bouton ci-dessous pour confirmer cette adresse email.
@@ -313,7 +311,7 @@ expected_fr_html_body_without_security = """
- Si vous avez des problèmes avec le bouton, vous pouvez copier et coller le lien suivant dans votre navigateur
+ Si vous avez des problèmes avec le bouton, vous pouvez copier et coller le lien suivant dans votre navigateur.
http://localhost/email-update?token=xxx
|
diff --git a/fittrackee/tests/emails/template_results/password_change.py b/fittrackee/tests/emails/template_results/password_change.py
index 64784069..77cd8269 100644
--- a/fittrackee/tests/emails/template_results/password_change.py
+++ b/fittrackee/tests/emails/template_results/password_change.py
@@ -68,9 +68,8 @@ expected_en_html_body = """
If this password change wasn't initiated by you, please change your password immediately or contact your administrator if your account is locked.
Thanks,
-
- The FitTrackee Team
-
+ The FitTrackee Team
+
@@ -120,9 +119,8 @@ expected_en_html_body_without_security = """
If this password change wasn't initiated by you, please change your password immediately or contact your administrator if your account is locked.
Thanks,
-
- The FitTrackee Team
-
+ The FitTrackee Team
+
@@ -173,9 +171,8 @@ expected_fr_html_body = """
Si vous n'êtes pas à l'origine de cette modification, veuillez changer votre mot de passe immédiatement ou contacter l'administrateur si votre compte est bloqué.
Merci,
-
- L'équipe FitTrackee
-
+ L'équipe FitTrackee
+
@@ -225,9 +222,8 @@ expected_fr_html_body_without_security = """
Si vous n'êtes pas à l'origine de cette modification, veuillez changer votre mot de passe immédiatement ou contacter l'administrateur si votre compte est bloqué.
Merci,
-
- L'équipe FitTrackee
-
+ L'équipe FitTrackee
+
diff --git a/fittrackee/tests/emails/template_results/password_reset_request.py b/fittrackee/tests/emails/template_results/password_reset_request.py
index 08914331..b3cebd7b 100644
--- a/fittrackee/tests/emails/template_results/password_reset_request.py
+++ b/fittrackee/tests/emails/template_results/password_reset_request.py
@@ -2,7 +2,8 @@
expected_en_text_body = """Hi test,
-You recently requested to reset your password for your FitTrackee account. Use the link below to reset it. This password reset link is only valid for 3 seconds.
+You recently requested to reset your password for your FitTrackee account. Use the link below to reset it.
+This password reset link is only valid for 3 seconds.
Reset your password: http://localhost/password-reset?token=xxx
@@ -15,7 +16,8 @@ http://localhost"""
expected_en_text_body_without_security = """Hi test,
-You recently requested to reset your password for your FitTrackee account. Use the link below to reset it. This password reset link is only valid for 3 seconds.
+You recently requested to reset your password for your FitTrackee account. Use the link below to reset it.
+This password reset link is only valid for 3 seconds.
Reset your password: http://localhost/password-reset?token=xxx
@@ -27,10 +29,10 @@ http://localhost"""
expected_fr_text_body = """Bonjour test,
-Vous avez récemment demandé la réinitialisation du mot de passe de votre compte sur FitTrackee.
-Cliquez sur le lien ci-dessous pour le réinitialiser. Ce lien n'est valide que pendant 3 secondes.
+Vous avez récemment demandé la réinitialisation du mot de passe de votre compte sur FitTrackee. Cliquez sur le lien ci-dessous pour le réinitialiser.
+Ce lien n'est valide que pendant 3 secondes.
-Réinitialiser le mot de passe : http://localhost/password-reset?token=xxx
+Réinitialiser le mot de passe: http://localhost/password-reset?token=xxx
Pour vérification, cette demande a été reçue à partir d'un appareil sous Linux, utilisant le navigateur Firefox.
Si vous n'avez pas demandé de réinitialisation, vous pouvez ignorer cet e-mail.
@@ -41,10 +43,10 @@ http://localhost"""
expected_fr_text_body_without_security = """Bonjour test,
-Vous avez récemment demandé la réinitialisation du mot de passe de votre compte sur FitTrackee.
-Cliquez sur le lien ci-dessous pour le réinitialiser. Ce lien n'est valide que pendant 3 secondes.
+Vous avez récemment demandé la réinitialisation du mot de passe de votre compte sur FitTrackee. Cliquez sur le lien ci-dessous pour le réinitialiser.
+Ce lien n'est valide que pendant 3 secondes.
-Réinitialiser le mot de passe : http://localhost/password-reset?token=xxx
+Réinitialiser le mot de passe: http://localhost/password-reset?token=xxx
Si vous n'avez pas demandé de réinitialisation, vous pouvez ignorer cet e-mail.
@@ -72,7 +74,7 @@ expected_en_html_body = """
Hi test,
- You recently requested to reset your password for your account. Use the button below to reset it.
+ You recently requested to reset your password for your FitTrackee account. Use the button below to reset it.
This password reset link is only valid for 3 seconds.
@@ -97,7 +99,7 @@ expected_en_html_body = """
- If you’re having trouble with the button above, copy and paste the URL below into your web browser.
+ If you're having trouble with the button above, copy and paste the URL below into your web browser.
http://localhost/password-reset?token=xxx
|
@@ -146,7 +148,7 @@ expected_en_html_body_without_security = """
Hi test,
- You recently requested to reset your password for your account. Use the button below to reset it.
+ You recently requested to reset your password for your FitTrackee account. Use the button below to reset it.
This password reset link is only valid for 3 seconds.
@@ -170,7 +172,7 @@ expected_en_html_body_without_security = """
- If you’re having trouble with the button above, copy and paste the URL below into your web browser.
+ If you're having trouble with the button above, copy and paste the URL below into your web browser.
http://localhost/password-reset?token=xxx
|
@@ -218,10 +220,9 @@ expected_fr_html_body = """
- Bonjour test,
- Vous avez récemment demandé la réinitialisation du mot de passe de votre compte sur FitTrackee.
- Cliquez sur le bouton ci-dessous pour le réinitialiser.
- Cette réinitialisation n'est valide que pendant 3 secondes.
+ Bonjour test,
+ Vous avez récemment demandé la réinitialisation du mot de passe de votre compte sur FitTrackee. Cliquez sur le bouton pour le réinitialiser.
+ Ce lien n'est valide que pendant 3 secondes.
@@ -245,7 +246,7 @@ expected_fr_html_body = """
- Si vous avez des problèmes avec le bouton, vous pouvez copier et coller le lien suivant dans votre navigateur
+ Si vous avez des problèmes avec le bouton, vous pouvez copier et coller le lien suivant dans votre navigateur.
http://localhost/password-reset?token=xxx
|
@@ -294,10 +295,9 @@ expected_fr_html_body_without_security = """
- Bonjour test,
- Vous avez récemment demandé la réinitialisation du mot de passe de votre compte sur FitTrackee.
- Cliquez sur le bouton ci-dessous pour le réinitialiser.
- Cette réinitialisation n'est valide que pendant 3 secondes.
+ Bonjour test,
+ Vous avez récemment demandé la réinitialisation du mot de passe de votre compte sur FitTrackee. Cliquez sur le bouton pour le réinitialiser.
+ Ce lien n'est valide que pendant 3 secondes.
@@ -320,7 +320,7 @@ expected_fr_html_body_without_security = """
- Si vous avez des problèmes avec le bouton, vous pouvez copier et coller le lien suivant dans votre navigateur
+ Si vous avez des problèmes avec le bouton, vous pouvez copier et coller le lien suivant dans votre navigateur.
http://localhost/password-reset?token=xxx
|
diff --git a/fittrackee/tests/emails/test_email_account_confirmation.py b/fittrackee/tests/emails/test_email_account_confirmation.py
index d3e6f861..bc1d4d48 100644
--- a/fittrackee/tests/emails/test_email_account_confirmation.py
+++ b/fittrackee/tests/emails/test_email_account_confirmation.py
@@ -32,7 +32,11 @@ class TestEmailTemplateForAccountConfirmation:
def test_it_gets_subject(
self, app: Flask, lang: str, expected_subject: str
) -> None:
- email_template = EmailTemplate(app.config['TEMPLATES_FOLDER'])
+ email_template = EmailTemplate(
+ app.config['TEMPLATES_FOLDER'],
+ app.config['TRANSLATIONS_FOLDER'],
+ app.config['LANGUAGES'],
+ )
subject = email_template.get_content(
'account_confirmation', lang, 'subject.txt', {}
@@ -50,7 +54,11 @@ class TestEmailTemplateForAccountConfirmation:
def test_it_gets_text_body(
self, app: Flask, lang: str, expected_text_body: str
) -> None:
- email_template = EmailTemplate(app.config['TEMPLATES_FOLDER'])
+ email_template = EmailTemplate(
+ app.config['TEMPLATES_FOLDER'],
+ app.config['TRANSLATIONS_FOLDER'],
+ app.config['LANGUAGES'],
+ )
text_body = email_template.get_content(
'account_confirmation', lang, 'body.txt', self.EMAIL_DATA
@@ -59,7 +67,11 @@ class TestEmailTemplateForAccountConfirmation:
assert text_body == expected_text_body
def test_it_gets_en_html_body(self, app: Flask) -> None:
- email_template = EmailTemplate(app.config['TEMPLATES_FOLDER'])
+ email_template = EmailTemplate(
+ app.config['TEMPLATES_FOLDER'],
+ app.config['TRANSLATIONS_FOLDER'],
+ app.config['LANGUAGES'],
+ )
text_body = email_template.get_content(
'account_confirmation', 'en', 'body.html', self.EMAIL_DATA
@@ -68,7 +80,11 @@ class TestEmailTemplateForAccountConfirmation:
assert expected_en_html_body in text_body
def test_it_gets_fr_html_body(self, app: Flask) -> None:
- email_template = EmailTemplate(app.config['TEMPLATES_FOLDER'])
+ email_template = EmailTemplate(
+ app.config['TEMPLATES_FOLDER'],
+ app.config['TRANSLATIONS_FOLDER'],
+ app.config['LANGUAGES'],
+ )
text_body = email_template.get_content(
'account_confirmation', 'fr', 'body.html', self.EMAIL_DATA
diff --git a/fittrackee/tests/emails/test_email_template_email_update.py b/fittrackee/tests/emails/test_email_template_email_update.py
index 872833a7..d634d107 100644
--- a/fittrackee/tests/emails/test_email_template_email_update.py
+++ b/fittrackee/tests/emails/test_email_template_email_update.py
@@ -47,7 +47,11 @@ class TestEmailTemplateForEmailUpdateToCurrentEmail:
def test_it_gets_subject(
self, app: Flask, lang: str, expected_subject: str
) -> None:
- email_template = EmailTemplate(app.config['TEMPLATES_FOLDER'])
+ email_template = EmailTemplate(
+ app.config['TEMPLATES_FOLDER'],
+ app.config['TRANSLATIONS_FOLDER'],
+ app.config['LANGUAGES']
+ )
subject = email_template.get_content(
'email_update_to_current_email', lang, 'subject.txt', {}
@@ -65,7 +69,11 @@ class TestEmailTemplateForEmailUpdateToCurrentEmail:
def test_it_gets_text_body(
self, app: Flask, lang: str, expected_text_body: str
) -> None:
- email_template = EmailTemplate(app.config['TEMPLATES_FOLDER'])
+ email_template = EmailTemplate(
+ app.config['TEMPLATES_FOLDER'],
+ app.config['TRANSLATIONS_FOLDER'],
+ app.config['LANGUAGES']
+ )
text_body = email_template.get_content(
'email_update_to_current_email', lang, 'body.txt', self.EMAIL_DATA
@@ -74,7 +82,11 @@ class TestEmailTemplateForEmailUpdateToCurrentEmail:
assert text_body == expected_text_body
def test_it_gets_en_html_body(self, app: Flask) -> None:
- email_template = EmailTemplate(app.config['TEMPLATES_FOLDER'])
+ email_template = EmailTemplate(
+ app.config['TEMPLATES_FOLDER'],
+ app.config['TRANSLATIONS_FOLDER'],
+ app.config['LANGUAGES']
+ )
text_body = email_template.get_content(
'email_update_to_current_email', 'en', 'body.html', self.EMAIL_DATA
@@ -83,7 +95,11 @@ class TestEmailTemplateForEmailUpdateToCurrentEmail:
assert expected_en_current_email_html_body in text_body
def test_it_gets_fr_html_body(self, app: Flask) -> None:
- email_template = EmailTemplate(app.config['TEMPLATES_FOLDER'])
+ email_template = EmailTemplate(
+ app.config['TEMPLATES_FOLDER'],
+ app.config['TRANSLATIONS_FOLDER'],
+ app.config['LANGUAGES']
+ )
text_body = email_template.get_content(
'email_update_to_current_email', 'fr', 'body.html', self.EMAIL_DATA
@@ -111,7 +127,11 @@ class TestEmailTemplateForEmailUpdateToNewEmail:
def test_it_gets_subject(
self, app: Flask, lang: str, expected_subject: str
) -> None:
- email_template = EmailTemplate(app.config['TEMPLATES_FOLDER'])
+ email_template = EmailTemplate(
+ app.config['TEMPLATES_FOLDER'],
+ app.config['TRANSLATIONS_FOLDER'],
+ app.config['LANGUAGES']
+ )
subject = email_template.get_content(
'email_update_to_new_email', lang, 'subject.txt', {}
@@ -129,7 +149,11 @@ class TestEmailTemplateForEmailUpdateToNewEmail:
def test_it_gets_text_body(
self, app: Flask, lang: str, expected_text_body: str
) -> None:
- email_template = EmailTemplate(app.config['TEMPLATES_FOLDER'])
+ email_template = EmailTemplate(
+ app.config['TEMPLATES_FOLDER'],
+ app.config['TRANSLATIONS_FOLDER'],
+ app.config['LANGUAGES']
+ )
text_body = email_template.get_content(
'email_update_to_new_email', lang, 'body.txt', self.EMAIL_DATA
@@ -138,7 +162,11 @@ class TestEmailTemplateForEmailUpdateToNewEmail:
assert text_body == expected_text_body
def test_it_gets_en_html_body(self, app: Flask) -> None:
- email_template = EmailTemplate(app.config['TEMPLATES_FOLDER'])
+ email_template = EmailTemplate(
+ app.config['TEMPLATES_FOLDER'],
+ app.config['TRANSLATIONS_FOLDER'],
+ app.config['LANGUAGES']
+ )
text_body = email_template.get_content(
'email_update_to_new_email', 'en', 'body.html', self.EMAIL_DATA
@@ -147,7 +175,11 @@ class TestEmailTemplateForEmailUpdateToNewEmail:
assert expected_en_new_email_html_body in text_body
def test_it_gets_fr_html_body(self, app: Flask) -> None:
- email_template = EmailTemplate(app.config['TEMPLATES_FOLDER'])
+ email_template = EmailTemplate(
+ app.config['TEMPLATES_FOLDER'],
+ app.config['TRANSLATIONS_FOLDER'],
+ app.config['LANGUAGES']
+ )
text_body = email_template.get_content(
'email_update_to_new_email', 'fr', 'body.html', self.EMAIL_DATA
@@ -173,7 +205,11 @@ class TestEmailTemplateForEmailUpdateToNewEmailWithoutSecurityInfos:
def test_it_gets_subject(
self, app: Flask, lang: str, expected_subject: str
) -> None:
- email_template = EmailTemplate(app.config['TEMPLATES_FOLDER'])
+ email_template = EmailTemplate(
+ app.config['TEMPLATES_FOLDER'],
+ app.config['TRANSLATIONS_FOLDER'],
+ app.config['LANGUAGES']
+ )
subject = email_template.get_content(
'email_update_to_new_email', lang, 'subject.txt', {}
@@ -191,7 +227,11 @@ class TestEmailTemplateForEmailUpdateToNewEmailWithoutSecurityInfos:
def test_it_gets_text_body(
self, app: Flask, lang: str, expected_text_body: str
) -> None:
- email_template = EmailTemplate(app.config['TEMPLATES_FOLDER'])
+ email_template = EmailTemplate(
+ app.config['TEMPLATES_FOLDER'],
+ app.config['TRANSLATIONS_FOLDER'],
+ app.config['LANGUAGES']
+ )
text_body = email_template.get_content(
'email_update_to_new_email', lang, 'body.txt', self.EMAIL_DATA
@@ -200,7 +240,11 @@ class TestEmailTemplateForEmailUpdateToNewEmailWithoutSecurityInfos:
assert text_body == expected_text_body
def test_it_gets_en_html_body(self, app: Flask) -> None:
- email_template = EmailTemplate(app.config['TEMPLATES_FOLDER'])
+ email_template = EmailTemplate(
+ app.config['TEMPLATES_FOLDER'],
+ app.config['TRANSLATIONS_FOLDER'],
+ app.config['LANGUAGES']
+ )
text_body = email_template.get_content(
'email_update_to_new_email', 'en', 'body.html', self.EMAIL_DATA
@@ -209,7 +253,11 @@ class TestEmailTemplateForEmailUpdateToNewEmailWithoutSecurityInfos:
assert expected_en_new_email_html_body_without_security in text_body
def test_it_gets_fr_html_body(self, app: Flask) -> None:
- email_template = EmailTemplate(app.config['TEMPLATES_FOLDER'])
+ email_template = EmailTemplate(
+ app.config['TEMPLATES_FOLDER'],
+ app.config['TRANSLATIONS_FOLDER'],
+ app.config['LANGUAGES']
+ )
text_body = email_template.get_content(
'email_update_to_new_email', 'fr', 'body.html', self.EMAIL_DATA
diff --git a/fittrackee/tests/emails/test_email_template_password_change.py b/fittrackee/tests/emails/test_email_template_password_change.py
index ec1ba8aa..655988d5 100644
--- a/fittrackee/tests/emails/test_email_template_password_change.py
+++ b/fittrackee/tests/emails/test_email_template_password_change.py
@@ -33,7 +33,11 @@ class TestEmailTemplateForPasswordChange:
def test_it_gets_subject(
self, app: Flask, lang: str, expected_subject: str
) -> None:
- email_template = EmailTemplate(app.config['TEMPLATES_FOLDER'])
+ email_template = EmailTemplate(
+ app.config['TEMPLATES_FOLDER'],
+ app.config['TRANSLATIONS_FOLDER'],
+ app.config['LANGUAGES'],
+ )
subject = email_template.get_content(
'password_change', lang, 'subject.txt', {}
@@ -51,7 +55,11 @@ class TestEmailTemplateForPasswordChange:
def test_it_gets_text_body(
self, app: Flask, lang: str, expected_text_body: str
) -> None:
- email_template = EmailTemplate(app.config['TEMPLATES_FOLDER'])
+ email_template = EmailTemplate(
+ app.config['TEMPLATES_FOLDER'],
+ app.config['TRANSLATIONS_FOLDER'],
+ app.config['LANGUAGES'],
+ )
text_body = email_template.get_content(
'password_change', lang, 'body.txt', self.EMAIL_DATA
@@ -60,7 +68,11 @@ class TestEmailTemplateForPasswordChange:
assert text_body == expected_text_body
def test_it_gets_en_html_body(self, app: Flask) -> None:
- email_template = EmailTemplate(app.config['TEMPLATES_FOLDER'])
+ email_template = EmailTemplate(
+ app.config['TEMPLATES_FOLDER'],
+ app.config['TRANSLATIONS_FOLDER'],
+ app.config['LANGUAGES'],
+ )
text_body = email_template.get_content(
'password_change', 'en', 'body.html', self.EMAIL_DATA
@@ -69,7 +81,11 @@ class TestEmailTemplateForPasswordChange:
assert expected_en_html_body in text_body
def test_it_gets_fr_html_body(self, app: Flask) -> None:
- email_template = EmailTemplate(app.config['TEMPLATES_FOLDER'])
+ email_template = EmailTemplate(
+ app.config['TEMPLATES_FOLDER'],
+ app.config['TRANSLATIONS_FOLDER'],
+ app.config['LANGUAGES'],
+ )
text_body = email_template.get_content(
'password_change', 'fr', 'body.html', self.EMAIL_DATA
@@ -94,7 +110,11 @@ class TestEmailTemplateForPasswordChangeWithSecurityInfos:
def test_it_gets_subject(
self, app: Flask, lang: str, expected_subject: str
) -> None:
- email_template = EmailTemplate(app.config['TEMPLATES_FOLDER'])
+ email_template = EmailTemplate(
+ app.config['TEMPLATES_FOLDER'],
+ app.config['TRANSLATIONS_FOLDER'],
+ app.config['LANGUAGES'],
+ )
subject = email_template.get_content(
'password_change', lang, 'subject.txt', {}
@@ -112,7 +132,11 @@ class TestEmailTemplateForPasswordChangeWithSecurityInfos:
def test_it_gets_text_body(
self, app: Flask, lang: str, expected_text_body: str
) -> None:
- email_template = EmailTemplate(app.config['TEMPLATES_FOLDER'])
+ email_template = EmailTemplate(
+ app.config['TEMPLATES_FOLDER'],
+ app.config['TRANSLATIONS_FOLDER'],
+ app.config['LANGUAGES'],
+ )
text_body = email_template.get_content(
'password_change', lang, 'body.txt', self.EMAIL_DATA
@@ -121,7 +145,11 @@ class TestEmailTemplateForPasswordChangeWithSecurityInfos:
assert text_body == expected_text_body
def test_it_gets_en_html_body(self, app: Flask) -> None:
- email_template = EmailTemplate(app.config['TEMPLATES_FOLDER'])
+ email_template = EmailTemplate(
+ app.config['TEMPLATES_FOLDER'],
+ app.config['TRANSLATIONS_FOLDER'],
+ app.config['LANGUAGES'],
+ )
text_body = email_template.get_content(
'password_change', 'en', 'body.html', self.EMAIL_DATA
@@ -130,7 +158,11 @@ class TestEmailTemplateForPasswordChangeWithSecurityInfos:
assert expected_en_html_body_without_security in text_body
def test_it_gets_fr_html_body(self, app: Flask) -> None:
- email_template = EmailTemplate(app.config['TEMPLATES_FOLDER'])
+ email_template = EmailTemplate(
+ app.config['TEMPLATES_FOLDER'],
+ app.config['TRANSLATIONS_FOLDER'],
+ app.config['LANGUAGES'],
+ )
text_body = email_template.get_content(
'password_change', 'fr', 'body.html', self.EMAIL_DATA
diff --git a/fittrackee/tests/emails/test_email_template_password_request.py b/fittrackee/tests/emails/test_email_template_password_request.py
index 251f8828..df5c6023 100644
--- a/fittrackee/tests/emails/test_email_template_password_request.py
+++ b/fittrackee/tests/emails/test_email_template_password_request.py
@@ -26,7 +26,11 @@ class TestEmailTemplateForPasswordRequest:
def test_it_gets_subject(
self, app: Flask, lang: str, expected_subject: str
) -> None:
- email_template = EmailTemplate(app.config['TEMPLATES_FOLDER'])
+ email_template = EmailTemplate(
+ app.config['TEMPLATES_FOLDER'],
+ app.config['TRANSLATIONS_FOLDER'],
+ app.config['LANGUAGES'],
+ )
subject = email_template.get_content(
'password_reset_request', lang, 'subject.txt', {}
@@ -41,7 +45,11 @@ class TestEmailTemplateForPasswordRequest:
def test_it_gets_text_body(
self, app: Flask, lang: str, expected_text_body: str
) -> None:
- email_template = EmailTemplate(app.config['TEMPLATES_FOLDER'])
+ email_template = EmailTemplate(
+ app.config['TEMPLATES_FOLDER'],
+ app.config['TRANSLATIONS_FOLDER'],
+ app.config['LANGUAGES'],
+ )
email_data = {
'expiration_delay': '3 seconds' if lang == 'en' else '3 secondes',
'username': 'test',
@@ -58,7 +66,11 @@ class TestEmailTemplateForPasswordRequest:
assert text_body == expected_text_body
def test_it_gets_en_html_body(self, app: Flask) -> None:
- email_template = EmailTemplate(app.config['TEMPLATES_FOLDER'])
+ email_template = EmailTemplate(
+ app.config['TEMPLATES_FOLDER'],
+ app.config['TRANSLATIONS_FOLDER'],
+ app.config['LANGUAGES'],
+ )
email_data = {
'expiration_delay': '3 seconds',
'username': 'test',
@@ -75,7 +87,11 @@ class TestEmailTemplateForPasswordRequest:
assert expected_en_html_body in text_body
def test_it_gets_fr_html_body(self, app: Flask) -> None:
- email_template = EmailTemplate(app.config['TEMPLATES_FOLDER'])
+ email_template = EmailTemplate(
+ app.config['TEMPLATES_FOLDER'],
+ app.config['TRANSLATIONS_FOLDER'],
+ app.config['LANGUAGES'],
+ )
email_data = {
'expiration_delay': '3 secondes',
'username': 'test',
@@ -103,7 +119,11 @@ class TestEmailTemplateForPasswordRequestWithoutSecurityInfos:
def test_it_gets_subject(
self, app: Flask, lang: str, expected_subject: str
) -> None:
- email_template = EmailTemplate(app.config['TEMPLATES_FOLDER'])
+ email_template = EmailTemplate(
+ app.config['TEMPLATES_FOLDER'],
+ app.config['TRANSLATIONS_FOLDER'],
+ app.config['LANGUAGES'],
+ )
subject = email_template.get_content(
'password_reset_request', lang, 'subject.txt', {}
@@ -121,7 +141,11 @@ class TestEmailTemplateForPasswordRequestWithoutSecurityInfos:
def test_it_gets_text_body(
self, app: Flask, lang: str, expected_text_body: str
) -> None:
- email_template = EmailTemplate(app.config['TEMPLATES_FOLDER'])
+ email_template = EmailTemplate(
+ app.config['TEMPLATES_FOLDER'],
+ app.config['TRANSLATIONS_FOLDER'],
+ app.config['LANGUAGES'],
+ )
email_data = {
'expiration_delay': '3 seconds' if lang == 'en' else '3 secondes',
'username': 'test',
@@ -136,7 +160,11 @@ class TestEmailTemplateForPasswordRequestWithoutSecurityInfos:
assert text_body == expected_text_body
def test_it_gets_en_html_body(self, app: Flask) -> None:
- email_template = EmailTemplate(app.config['TEMPLATES_FOLDER'])
+ email_template = EmailTemplate(
+ app.config['TEMPLATES_FOLDER'],
+ app.config['TRANSLATIONS_FOLDER'],
+ app.config['LANGUAGES'],
+ )
email_data = {
'expiration_delay': '3 seconds',
'username': 'test',
@@ -151,7 +179,11 @@ class TestEmailTemplateForPasswordRequestWithoutSecurityInfos:
assert expected_en_html_body_without_security in text_body
def test_it_gets_fr_html_body(self, app: Flask) -> None:
- email_template = EmailTemplate(app.config['TEMPLATES_FOLDER'])
+ email_template = EmailTemplate(
+ app.config['TEMPLATES_FOLDER'],
+ app.config['TRANSLATIONS_FOLDER'],
+ app.config['LANGUAGES'],
+ )
email_data = {
'expiration_delay': '3 secondes',
'username': 'test',
diff --git a/messages.pot b/messages.pot
new file mode 100644
index 00000000..621e08bb
--- /dev/null
+++ b/messages.pot
@@ -0,0 +1,206 @@
+# Translations template for PROJECT.
+# Copyright (C) 2022 ORGANIZATION
+# This file is distributed under the same license as the PROJECT project.
+# FIRST AUTHOR , 2022.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PROJECT VERSION\n"
+"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
+"POT-Creation-Date: 2022-07-03 07:58+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: LANGUAGE \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: Babel 2.10.3\n"
+
+#: fittrackee/emails/templates/layout.html:215
+#: fittrackee/emails/templates/layout.txt:1
+#, python-format
+msgid "Hi %(username)s,"
+msgstr ""
+
+#: fittrackee/emails/templates/account_confirmation/body.txt:6
+#: fittrackee/emails/templates/email_update_to_current_email/body.txt:3
+#: fittrackee/emails/templates/email_update_to_new_email/body.txt:6
+#: fittrackee/emails/templates/layout.html:218
+#: fittrackee/emails/templates/password_change/body.txt:3
+#: fittrackee/emails/templates/password_reset_request/body.txt:6
+#, python-format
+msgid ""
+"For security, this request was received from a %(operating_system)s "
+"device using %(browser_name)s."
+msgstr ""
+
+#: fittrackee/emails/templates/layout.html:221
+#: fittrackee/emails/templates/layout.txt:5
+msgid "Thanks,"
+msgstr ""
+
+#: fittrackee/emails/templates/layout.html:222
+#: fittrackee/emails/templates/layout.txt:6
+msgid "The FitTrackee Team"
+msgstr ""
+
+#: fittrackee/emails/templates/account_confirmation/body.html:2
+#: fittrackee/emails/templates/account_confirmation/subject.txt:1
+msgid "Confirm your account"
+msgstr ""
+
+#: fittrackee/emails/templates/account_confirmation/body.html:3
+msgid "Use this link to confirm your account."
+msgstr ""
+
+#: fittrackee/emails/templates/account_confirmation/body.html:4
+#: fittrackee/emails/templates/account_confirmation/body.txt:1
+msgid "You have created an account on FitTrackee."
+msgstr ""
+
+#: fittrackee/emails/templates/account_confirmation/body.html:4
+msgid "Use the button below to confirm your address email."
+msgstr ""
+
+#: fittrackee/emails/templates/account_confirmation/body.html:11
+#: fittrackee/emails/templates/account_confirmation/body.txt:4
+#: fittrackee/emails/templates/email_update_to_new_email/body.html:11
+#: fittrackee/emails/templates/email_update_to_new_email/body.txt:4
+msgid "Verify your email"
+msgstr ""
+
+#: fittrackee/emails/templates/account_confirmation/body.html:18
+#: fittrackee/emails/templates/account_confirmation/body.txt:7
+msgid ""
+"If this account creation wasn't initiated by you, please ignore this "
+"email."
+msgstr ""
+
+#: fittrackee/emails/templates/account_confirmation/body.html:22
+#: fittrackee/emails/templates/email_update_to_new_email/body.html:22
+#: fittrackee/emails/templates/password_reset_request/body.html:24
+msgid ""
+"If you're having trouble with the button above, copy and paste the URL "
+"below into your web browser."
+msgstr ""
+
+#: fittrackee/emails/templates/account_confirmation/body.txt:2
+msgid "Use the link below to confirm your address email."
+msgstr ""
+
+#: fittrackee/emails/templates/email_update_to_current_email/body.html:2
+#: fittrackee/emails/templates/email_update_to_current_email/subject.txt:1
+msgid "Email changed"
+msgstr ""
+
+#: fittrackee/emails/templates/email_update_to_current_email/body.html:3
+msgid "Your email is being updated."
+msgstr ""
+
+#: fittrackee/emails/templates/email_update_to_current_email/body.html:4
+#: fittrackee/emails/templates/email_update_to_current_email/body.txt:1
+msgid ""
+"You recently requested to change your email address for your FitTrackee "
+"account to:"
+msgstr ""
+
+#: fittrackee/emails/templates/email_update_to_current_email/body.html:18
+#: fittrackee/emails/templates/email_update_to_current_email/body.txt:4
+msgid ""
+"If this email change wasn't initiated by you, please change your password"
+" immediately or contact your administrator if your account is locked."
+msgstr ""
+
+#: fittrackee/emails/templates/email_update_to_new_email/body.html:2
+#: fittrackee/emails/templates/email_update_to_new_email/subject.txt:1
+msgid "Confirm email change"
+msgstr ""
+
+#: fittrackee/emails/templates/email_update_to_new_email/body.html:3
+msgid "Use this link to confirm email change."
+msgstr ""
+
+#: fittrackee/emails/templates/email_update_to_new_email/body.html:4
+#: fittrackee/emails/templates/email_update_to_new_email/body.txt:1
+msgid ""
+"You recently requested to change your email address for your FitTrackee "
+"account."
+msgstr ""
+
+#: fittrackee/emails/templates/email_update_to_new_email/body.html:4
+msgid "Use the button below to confirm this address."
+msgstr ""
+
+#: fittrackee/emails/templates/email_update_to_new_email/body.html:18
+#: fittrackee/emails/templates/email_update_to_new_email/body.txt:7
+msgid "If this email change wasn't initiated by you, please ignore this email."
+msgstr ""
+
+#: fittrackee/emails/templates/email_update_to_new_email/body.txt:2
+msgid "Use the link below to confirm this address."
+msgstr ""
+
+#: fittrackee/emails/templates/password_change/body.html:2
+#: fittrackee/emails/templates/password_change/subject.txt:1
+msgid "Password changed"
+msgstr ""
+
+#: fittrackee/emails/templates/password_change/body.html:3
+msgid "Your password has been changed."
+msgstr ""
+
+#: fittrackee/emails/templates/password_change/body.html:4
+#: fittrackee/emails/templates/password_change/body.txt:1
+msgid "The password for your FitTrackee account has been changed."
+msgstr ""
+
+#: fittrackee/emails/templates/password_change/body.html:5
+#: fittrackee/emails/templates/password_change/body.txt:4
+msgid ""
+"If this password change wasn't initiated by you, please change your "
+"password immediately or contact your administrator if your account is "
+"locked."
+msgstr ""
+
+#: fittrackee/emails/templates/password_reset_request/body.html:2
+#: fittrackee/emails/templates/password_reset_request/subject.txt:1
+msgid "Password reset request"
+msgstr ""
+
+#: fittrackee/emails/templates/password_reset_request/body.html:3
+#, python-format
+msgid ""
+"Use this link to reset your password. The link is only valid for "
+"%(expiration_delay)s."
+msgstr ""
+
+#: fittrackee/emails/templates/password_reset_request/body.html:4
+#: fittrackee/emails/templates/password_reset_request/body.txt:1
+msgid "You recently requested to reset your password for your FitTrackee account."
+msgstr ""
+
+#: fittrackee/emails/templates/password_reset_request/body.html:4
+msgid "Use the button below to reset it."
+msgstr ""
+
+#: fittrackee/emails/templates/password_reset_request/body.html:5
+#: fittrackee/emails/templates/password_reset_request/body.txt:2
+#, python-format
+msgid "This password reset link is only valid for %(expiration_delay)s."
+msgstr ""
+
+#: fittrackee/emails/templates/password_reset_request/body.html:13
+#: fittrackee/emails/templates/password_reset_request/body.txt:4
+msgid "Reset your password"
+msgstr ""
+
+#: fittrackee/emails/templates/password_reset_request/body.html:20
+#: fittrackee/emails/templates/password_reset_request/body.txt:7
+msgid "If you did not request a password reset, please ignore this email."
+msgstr ""
+
+#: fittrackee/emails/templates/password_reset_request/body.txt:1
+msgid "Use the link below to reset it."
+msgstr ""
+
diff --git a/poetry.lock b/poetry.lock
index 30be350e..663883ef 100644
--- a/poetry.lock
+++ b/poetry.lock
@@ -68,7 +68,7 @@ tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>
name = "babel"
version = "2.10.3"
description = "Internationalization utilities"
-category = "dev"
+category = "main"
optional = false
python-versions = ">=3.6"
@@ -1466,7 +1466,7 @@ testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-
[metadata]
lock-version = "1.1"
python-versions = "^3.7"
-content-hash = "327d5c6a151cd6c0130a2e1f980fd5e8259ea59a9972407947c9a64124033c0a"
+content-hash = "fabbeac65ba304e8051b1453c13f872ef5fc8ed1a6ea7cc236a6d8ede34d9600"
[metadata.files]
alabaster = [
diff --git a/pyproject.toml b/pyproject.toml
index f2a3d476..5f24216f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -41,6 +41,7 @@ staticmap = "^0.5.4"
SQLAlchemy = "1.4.37"
pyOpenSSL = "^22.0"
ua-parser = "^0.10.0"
+Babel = "^2.10.3"
[tool.poetry.dev-dependencies]
black = "^22.3"
| | | | | | | | | | |