This repository has been archived by the owner on Oct 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into nettoyage-api-publique
- Loading branch information
Showing
18 changed files
with
606 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,20 +62,22 @@ def test_unknown_siret_wont_create_anything(self): | |
def test_invalid_siret_wont_create_anything(self): | ||
self.add_row(["foo", "1234", "", "[email protected]", "", ""]) | ||
out, err = self.call_command() | ||
self.assertIn("Siret invalide", err) | ||
self.assertIn("Le numéro SIRET doit être composé de 14 chiffres.", err) | ||
self.assertIn("siret", err) | ||
self.assertFalse(Structure.objects.filter(siret="12345").exists()) | ||
self.assertFalse(User.objects.filter(email="[email protected]").exists()) | ||
self.assertEqual(len(mail.outbox), 0) | ||
|
||
def test_invalid_parent_siret_error(self): | ||
self.add_row(["foo", "", "1234", "[email protected]", "", ""]) | ||
out, err = self.call_command() | ||
self.assertIn("Siret parent invalide", err) | ||
self.assertIn("Le numéro SIRET doit être composé de 14 chiffres.", err) | ||
self.assertIn("parent_siret", err) | ||
|
||
def test_unknown_parent_siret_error(self): | ||
self.add_row(["foo", "", "12345678901234", "[email protected]", "", ""]) | ||
out, err = self.call_command() | ||
self.assertIn("Siret parent inconnu", err) | ||
self.assertIn("SIRET parent inconnu", err) | ||
|
||
def test_missing_siret_error(self): | ||
self.add_row(["foo", "", "", "[email protected]", "", ""]) | ||
|
@@ -88,7 +90,7 @@ def test_no_recursive_branch(self): | |
self.add_row(["foo", "", "12345678901234", "[email protected]", "", ""]) | ||
out, err = self.call_command() | ||
self.assertIn( | ||
"Le siret 12345678901234 est une antenne, il ne peut pas être utilisé comme parent", | ||
"Le SIRET 12345678901234 est une antenne, il ne peut pas être utilisé comme parent", | ||
err, | ||
) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,6 +49,8 @@ def make_di_service_data(**kwargs) -> dict: | |
"zone_diffusion_nom": "foo", | ||
"structure": { | ||
"nom": "Rouge Empire", | ||
"telephone": "1234", | ||
"courriel": "[email protected]", | ||
}, | ||
}, | ||
**kwargs, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,6 +109,8 @@ class Meta: | |
"siret", | ||
"slug", | ||
"url", | ||
"phone", | ||
"email", | ||
] | ||
read_only_fields = [ | ||
"city", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
{% extends "email-base.mjml" %} | ||
|
||
{% block preview %} | ||
Découvrez le service « {{ service.name }} » recommandé par {{ sender_name }}. | ||
{% endblock %} | ||
|
||
{% block illustration %} | ||
<mj-image src="{% frontend_url %}/emails/illu-orientation.png" alt=""/> | ||
{% endblock %} | ||
|
||
{% block title %} | ||
{% if for_beneficiary %} | ||
On vous a recommandé une solution | ||
{% else %} | ||
On vous a recommandé un service | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<p> | ||
<strong>Bonjour,</strong> | ||
</p> | ||
|
||
<p>{{ sender_name }} vous a recommandé le service | ||
suivant : | ||
</p> | ||
<div style="color: #555555; background-color: #F0F8FF; border-radius: 12px; | ||
padding: 16px 24px; margin: 24px 0"> | ||
<div style="color: #555555, font-size: 14px; line-height: 24px; margin-bottom: 2px">{{ service.structure_info.name }}</div> | ||
<div> | ||
<a href="{{ cta_link }}" | ||
style="color: #000091; font-size: 23px; font-weight: 700; text-decoration-line: none; line-height: 26px"> | ||
{{ service.name }} | ||
</a> | ||
</div> | ||
<div style="color: #555555, font-size: 13px; line-height: 24px; margin-top: 6px"> | ||
{% if service.address1 %} | ||
{{service.address1}}{% if service.address2 %}, {{ service.address2}}{% endif %}, | ||
{{ service.postal_code }} {{ service.city }} | ||
{% endif %} | ||
</div> | ||
</div> | ||
|
||
|
||
<h2 style="margin-bottom: 8px"> | ||
Le public concerné : | ||
</h2> | ||
|
||
<ul> | ||
{% for item in publics %} | ||
<li>{{ item }}</li> | ||
{% endfor %} | ||
</ul> | ||
|
||
<h2 style="margin-bottom: 8px"> | ||
Les critères et compétences : | ||
</h2> | ||
|
||
<ul> | ||
{% for item in requirements %} | ||
<li>{{ item }}</li> | ||
{% endfor %} | ||
</ul> | ||
|
||
|
||
{% if not modes %} | ||
{% if for_beneficiary %} | ||
<h2 style="margin-bottom: 8px"> | ||
Comment mobiliser ce service : | ||
</h2> | ||
|
||
<p style="color: #ED7D00; font-style: italic;">Demandez de l’aide à votre conseiller ou à un professionnel qui travaille | ||
dans l’insertion pour savoir comment accéder à ce service.</p> | ||
{% endif %} | ||
|
||
{% else %} | ||
<h2 style="margin-bottom: 8px"> | ||
Comment mobiliser ce service : | ||
</h2> | ||
|
||
<ul> | ||
{% for item in modes %} | ||
<li>{{ item }}</li> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block cta %} | ||
<mj-button mj-class="cta" href="{{ cta_link }}"> | ||
Consulter le service | ||
</mj-button> | ||
<mj-spacer height="24px"/> | ||
{% endblock %} |
Oops, something went wrong.