Skip to content

Commit

Permalink
delete service in alumni phase
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastienReuiller committed Jan 25, 2024
1 parent 1a1c353 commit 3842250
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 12 deletions.
40 changes: 28 additions & 12 deletions services/management/commands/syncbetadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def handle(self, *args, **options):
)

def sync_services(self):
# TODO: Delete services that no longer exist

self.stdout.write("Fetch services data")
self.gip_startups = []
resp = httpx.get(BETA_GOUV_STARTUPS_ENDPOINT)
Expand All @@ -45,17 +45,22 @@ def sync_services(self):
service = self.get_markdown_section("Notre service", markdown_content)
problem = self.get_markdown_section("Le problème", markdown_content)
phases = data["attributes"].get("phases", [{"name": ""}])
attributes = {
"beta_id": data["id"],
"title": data["attributes"]["name"],
"pitch": data["attributes"]["pitch"],
"link": link,
"problem": problem,
"service": service,
"last_phase": phases[-1]["name"],
}
self.create_or_update_service(data["id"], attributes)
self.gip_startups.append(data["id"])
last_phase = phases[-1]["name"]

if last_phase == "alumni":
self.delete_service(data["id"])
else:
attributes = {
"beta_id": data["id"],
"title": data["attributes"]["name"],
"pitch": data["attributes"]["pitch"],
"link": link,
"problem": problem,
"service": service,
"last_phase": last_phase,
}
self.create_or_update_service(data["id"], attributes)
self.gip_startups.append(data["id"])

def fetch_active_member_on_startup(self):
self.active_members = {}
Expand Down Expand Up @@ -132,6 +137,17 @@ def create_or_update_service(self, service_id, attributes):
"A page called 'Nos services' with slug 'nos-services' is needed to add new service"
)

def delete_service(self, service_id):
try:
service = ServicePage.objects.get(beta_id=service_id)
service.delete()
self.stdout.write(f"Service deleted!")

# TODO: check if add redirection to avoid 404 is needed
except ServicePage.DoesNotExist:
self.stdout.write(f"Service already deleted.")
pass # service already deleted

def create_or_update_member(self, member_id, services, attributes):
# try to update
try:
Expand Down
34 changes: 34 additions & 0 deletions services/mocks/startups.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,40 @@



}
, "relationships":
{ "incubator":
{ "data": { "type": "incubator", "id": "gip-inclusion" }
}
}
},
{ "id" : "carnet.de.bord"
, "type" : "startup"
, "attributes":
{ "name" : "Carnet de bord"
, "pitch" : "Partager le parcours d’insertion pour faciliter les avancées des personnes."
, "stats_url": "https://matomo-metabase-carnetdebord.fabrique.social.gouv.fr/public/dashboard/81a749aa-6c29-46b2-9ca5-df9d90fd3257"

, "link": "https://carnetdebord.inclusion.beta.gouv.fr/"
, "repository": "https://github.com/gip-inclusion/carnet-de-bord"
, "contact": "[email protected]"
, "content_url_encoded_markdown": "%23%202024%20-%20Pause%20dans%20le%20d%C3%A9veloppement%20du%20service%20num%C3%A9rique%20%0A%0A%2A%2ALe%20d%C3%A9veloppement%20du%20produit%20num%C3%A9rique%20dans%20sa%20forme%20actuelle%20est%20arr%C3%AAt%C3%A9.%2A%2A%20L%E2%80%99%C3%A9quipe%20continuera%20d%E2%80%99assurer%20dans%20les%20prochains%20mois%20l%E2%80%99accompagnement%20et%20le%20support%20des%20utilisateurs%20actuels%2C%20sans%20%C3%A9volutions%20techniques%20ou%20fonctionnelles.%0A%0AEn%20lien%20avec%20l%E2%80%99incubateur%20de%20P%C3%B4le%20emploi%20et%20dans%20le%20cadre%20des%20exp%C3%A9rimentations%20de%20la%20%5Br%C3%A9forme%20France%20Travail%5D%28https%3A%2F%2Ftravail-emploi.gouv.fr%2Femploi-et-insertion%2Ffrance-travail%2F%29%2C%20la%20promesse%20de%20la%20co-construction%20d%E2%80%99un%20service%20num%C3%A9rique%20public%20de%20suivi%20de%20parcours%20des%20usagers%20n%E2%80%99est%20toutefois%20pas%20abandonn%C3%A9e.%20%2A%2AC%E2%80%99est%20donc%20d%E2%80%99avantage%20une%20deuxi%C3%A8me%20mouture%20de%20%C2%AB%20Carnet%20de%20bord%20%C2%BB%20qui%20se%20profile%20avec%20des%20discussions%20et%20des%20chantiers%20d%E2%80%99ores%20et%20d%C3%A9j%C3%A0%20engag%C3%A9s%20par%20l%E2%80%99%C3%89tat.%20Nous%20vous%20communiquerons%20prochainement%20sur%20cette%20page%20les%20contacts%20des%20%C3%A9quipes%20en%20charge%20de%20ce%20travail.%2A%2A%0A%0A%23%23%20Contexte%20et%20constat%0A%0A%2A%2AEn%20octobre%202023%2C%20un%20%C2%AB%20comit%C3%A9%20produit%20%C2%BB%20s%E2%80%99est%20r%C3%A9uni%2A%2A.%20Il%20s%E2%80%99agit%20d%E2%80%99un%20%C3%A9v%C3%A9nement%20classique%20dans%20l%E2%80%99%C3%A9cosyst%C3%A8me%20%5Bbeta.gouv%5D%28https%3A%2F%2Fbeta.gouv.fr%29%20ayant%20lieu%20tous%20les%206%20mois%20pour%20tous%20les%20produits%20num%C3%A9riques%20publics%20d%C3%A9velopp%C3%A9s%20en%20mode%20%C2%AB%20agile%20%C2%BB%20qui%2C%20pour%20rappel%2C%20sont%20engag%C3%A9s%20dans%20des%20cycles%20de%20d%C3%A9veloppement%20fonctionnel%20courts%2C%20dans%20une%20it%C3%A9ration%20r%C3%A9guli%C3%A8re%20avec%20leurs%20utilisateurs%20et%20dans%20l%27%C3%A9valuation%20par%20l%E2%80%99impact.%0A%0ACe%20comit%C3%A9%20s%E2%80%99inscrivait%20notamment%20dans%20le%20cadre%20de%20la%20%2A%2Amise%20en%20place%20d%E2%80%99une%20nouvelle%20comitologie%20produit%20dans%20le%20cadre%20de%20France%20Travail%2A%2A%2C%20r%C3%A9unissant%20ainsi%20dans%20ce%20cadre%20des%20membres%20de%20la%20direction%20g%C3%A9n%C3%A9rale%20de%20P%C3%B4le%20emploi%20ou%20du%20Haut%20Commissariat%20%C3%A0%20l%E2%80%99Emploi%20et%20%C3%A0%20l%E2%80%99Engagement%20des%20entreprises.%0A%0AL%E2%80%99%C3%A9quipe%20a%20dress%C3%A9%20un%20constat%20de%20l%E2%80%99usage%20de%20Carnet%20de%20bord%20et%20a%20%C3%A9tabli%20que%20%2A%2Al%E2%80%99%5Bimpact%20attendu%5D%28https%3A%2F%2Fmetabase.carnetdebord.inclusion.beta.gouv.fr%2Fpublic%2Fdashboard%2F81a749aa-6c29-46b2-9ca5-df9d90fd3257%29%20%28nombre%20de%20consultations%2C%20nombre%20de%20modification%20de%20carnets%2C%20etc.%29%20n%E2%80%99%C3%A9tait%20peut-%C3%AAtre%20pas%20%C3%A0%20la%20hauteur%20de%20l%E2%80%99investissement%20consenti%20par%20l%E2%80%99Etat%20dans%20son%20d%C3%A9veloppement.%2A%2A%20Il%20a%20donc%20%C3%A9t%C3%A9%20d%C3%A9cid%C3%A9%20-%20non%20pas%20d%E2%80%99arr%C3%AAter%20le%20produit%20-%20mais%20de%20temporiser%20son%20activit%C3%A9%20actuelle%20en%20laissant%20-%20comme%20%C3%A9voqu%C3%A9%20ci-dessus%20-%20uniquement%20de%20la%20ressource%20sur%20le%20seul%20support%20courant%20utilisateur%2C%20d%E2%80%99une%20part%2C%20et%20sur%20la%20r%C3%A9solution%20de%20bugs%20le%20cas%20%C3%A9ch%C3%A9ant%2C%20d%E2%80%99autre%20part.%0A%0A%23%23%20Quels%20apprentissages%20%3F%0A%0ATechniquement%2C%20le%20produit%20dans%20sa%20configuration%20actuelle%20atteignait%20ses%20limites%20%3A%20de%20%2A%2Anombreux%20bugs%20rythmaient%20la%20vie%20de%20l%E2%80%99outil%2A%2A%2C%20d%C3%A9gradant%20fortement%20l%E2%80%99exp%C3%A9rience%20utilisateur%2C%20et%20le%20%2A%2Atemps%20d%E2%80%99impl%C3%A9mentation%20de%20nouvelles%20fonctionnalit%C3%A9s%20%C3%A9tait%20%C3%A9lev%C3%A9%2A%2A.%20%C3%80%20cet%20%C3%A9gard%2C%20il%20s%E2%80%99agit%20de%20relever%20que%20le%20d%C3%A9veloppement%20de%20l%E2%80%99application%20et%20l%E2%80%99exercice%20de%20priorisation%20dans%20la%20feuille%20de%20route%20%C3%A9taient%20souvent%20perturb%C3%A9s%20par%20une%20tension%20intrins%C3%A8que%20au%20produit%20entre%20ceux%20qui%20voyaient%20dans%20Carnet%20de%20bord%20%2A%2Aun%20espace%20privil%C3%A9gi%C3%A9%20de%20partage%20de%20donn%C3%A9es%20automatis%C3%A9es%2A%2A%20et%20provenant%20de%20logiciels%20tiers%20%28logiciels%20%C3%A9diteurs%2C%20autres%20SI%20publics%29%20et%20ceux%20qui%20esp%C3%A9raient%20faire%20de%20Carnet%20de%20bord%20%2A%2Aun%20logiciel%20de%20parcours%20complet%2A%2A%20utilis%C3%A9%20au%20quotidien%20par%20les%20professionnels.%0A%0APar%20ailleurs%2C%20sur%20le%20cas%20d%E2%80%99usage%20majoritaire%20au%20sein%20des%20exp%C3%A9rimentations%20%28l%E2%80%99accompagnement%20de%20b%C3%A9n%C3%A9ficiaires%20du%20RSA%20%3A%20du%20t%C3%A9l%C3%A9chargement%20des%20flux%20%C3%A0%20la%20saisie%20du%20contrat%20d%E2%80%99engagement%20r%C3%A9ciproque%29%2C%20%2A%2Acertaines%20fonctionnalit%C3%A9s%20%C3%A9taient%20fortement%20attendues%20par%20les%20professionnels.%2A%2A%0A%0A-%20L%E2%80%99absence%20de%20celles-ci%20emp%C3%AAchait%20une%20bascule%20int%C3%A9grale%20sur%20Carnet%20de%20bord%20%3A%20interconnexion%20compl%C3%A8te%20avec%20le%20SI%20P%C3%B4le%20emploi%2C%20notamment%20sur%20le%20p%C3%A9rim%C3%A8tre%20du%20diagnostic%20socio-professionnel%20%3B%20r%C3%A9alisation%20d%E2%80%99exports%20et%20possibilit%C3%A9%20de%20requ%C3%AAtage%20%3B%20tableaux%20de%20pilotage%20%3B%20gestion%20compl%C3%A8te%20du%20CER%20dans%20l%E2%80%99outil%20%28%C3%A9dition%2C%20validation%2C%20t%C3%A9l%C3%A9chargement%29%20%3B%20r%C3%A9alisation%20de%20bilans%20d%E2%80%99accompagnement%2C%20possibilit%C3%A9s%20accrues%20d%E2%80%99%C3%A9changes%20entre%20professionnels%20%3B%20interconnexion%20entre%20les%20logiciels%20de%20gestion%20et%20Carnet%20de%20bord.%0A-%20En%20cons%C3%A9quence%2C%20ces%20manques%20fonctionnels%20entrainaient%20bien%20souvent%20pour%20les%20professionnels%20des%20%2A%2Adouble-saisies%2A%2A%2C%20voire%20triple-saisies%2C%20exp%C3%A9rience%20tr%C3%A8s%20pr%C3%A9judiciable%20%C3%A0%20la%20r%C3%A9tention%20des%20utilisateurs.%0A%0AEnfin%2C%20le%20%2A%2Afaible%20nombre%20d%E2%80%99accompagnateurs%2A%2A%20embarqu%C3%A9s%20sur%20Carnet%20de%20bord%2C%20notamment%20en%20dehors%20des%20conseils%20d%C3%A9partementaux%2C%20%2A%2Adiminuait%20fortement%20la%20valeur%20du%20partage%20d%E2%80%99informations%20et%20la%20plus-value%20de%20Carnet%20de%20bord%2A%2A%20pour%20conseillers%20en%20insertion%20et%20travailleurs%20sociaux%20des%20d%C3%A9partements%20%3A%20la%20promesse%20d%E2%80%99un%20gain%20d%E2%80%99informations%20sur%20les%20usagers%20obtenu%20gr%C3%A2ce%20%C3%A0%20Carnet%20de%20bord%20n%E2%80%99%C3%A9tait%20pas%20tenue.%0A%0A%23%23%20Quelle%20suite%20pour%20Carnet%20de%20bord%20et%20l%E2%80%99id%C3%A9e%20d%E2%80%99un%20outil%20de%20suivi%20de%20parcours%20%3F%0A%0ALe%20Haut%20Commissariat%20%C3%A0%20l%E2%80%99Emploi%20et%20%C3%A0%20l%E2%80%99Engagement%20des%20Entreprises%20%28HC3E%29%20s%E2%80%99est%20entretenu%20%C3%A0%20l%E2%80%99automne%202023%20avec%20de%20nombreux%20d%C3%A9partements%20utilisateurs%20de%20Carnet%20de%20bord%20et%2C%20dans%20le%20cadre%20de%20France%20Travail%20notamment%2C%20est%20toutefois%20ressortie%20%2A%2Aune%20forte%20volont%C3%A9%20des%20conseils%20d%C3%A9partementaux%20de%20poursuivre%20la%20co-construction%20d%E2%80%99un%20outil%20num%C3%A9rique%20public%20de%20parcours%20des%20usagers%20en%20insertion%2A%2A%20%28en%20sus%20de%20l%E2%80%99offre%20d%C3%A9j%C3%A0%20propos%C3%A9e%20par%20des%20%C3%A9diteurs%20de%20logiciel%20ou%20se%20mat%C3%A9rialisant%20dans%20les%20logiciels%20%C2%AB%20maison%20%C2%BB%29.%20Un%20Carnet%20de%20bord%20%C2%AB%20V2%20%C2%BB%20a%20donc%20vocation%20%C3%A0%20voir%20le%20jour%2C%20mobilisant%20des%20%C3%A9quipes%20et%20technologies%20diff%C3%A9rentes.%20Dans%20ce%20cadre%2C%20%2A%2Ade%20premiers%20chantiers%20exploratoires%20sont%20en%20cours%20au%20sein%20de%20P%C3%B4le%20emploi%20pour%20reprendre%20le%20flambeau%20du%20Groupement%20d%E2%80%99int%C3%A9r%C3%AAt%20public%20%28GIP%29%20Plateforme%20de%20l%E2%80%99inclusion%2A%2A.%20Les%20%C3%A9quipes%20concern%C3%A9es%20peuvent%20capitaliser%20sur%20certains%20acquis%20solides%20de%20Carnet%20de%20bord%20%3A%0A%0A-%20%2A%2AUne%20s%C3%A9curisation%20juridique%20pouss%C3%A9e%2A%2A%20%3A%20un%20%5Bd%C3%A9cret%5D%28https%3A%2F%2Fwww.legifrance.gouv.fr%2Fjorf%2Fid%2FJORFTEXT000047318824%29%20a%20%C3%A9t%C3%A9%20publi%C3%A9%20pour%20encadrer%20les%20%C3%A9changes%20de%20donn%C3%A9es%20entre%20tous%20les%20acteurs%20de%20l%E2%80%99insertion%20%3B%0A-%20%2A%2AR%C3%A9f%C3%A9rentiel%20de%20donn%C3%A9es%2A%2A%20%3A%20une%20nomenclature%20nationale%20des%20donn%C3%A9es%20de%20diagnostic%20socio-professionnel%20et%20des%20%C3%A9l%C3%A9ments%20de%20parcours%20%28objectifs%20et%20actions%29%20a%20%C3%A9t%C3%A9%20co-construite%20avec%20les%20professionnels%20et%20peut%20grandement%20faciliter%20les%20%C3%A9changes%20de%20donn%C3%A9es%20%28les%20interconnections%20techniques%20entre%20SI%20reposant%20en%20effet%20avant%20tout%20sur%20une%20interop%C3%A9rabilit%C3%A9%20s%C3%A9mantique%29%20%3B%0A-%20%2A%2AUn%20mode%20d%E2%80%99habilitation%20simple%2A%2A%20%3A%20une%20matrice%20d%E2%80%99habilitation%20permet%20la%20cr%C3%A9ation%20rapide%20et%20autonome%20de%20nouvelles%20structures%20et%20professionnels%20%28l%E2%80%99outil%20est%20g%C3%A9r%C3%A9%20au%20niveau%20local%29%20%3B%0A-%20%2A%2AUne%20m%C3%A9thode%20it%C3%A9rative%20qui%20a%20fait%20ses%20preuves%2A%2A%20%3A%20des%20%C3%A9changes%20r%C3%A9guliers%20ont%20permis%20de%20bien%20comprendre%20ce%20qui%20%C3%A9tait%20attendu%20par%20les%20professionnels%20de%20l%E2%80%99insertion.%20Plus%20particuli%C3%A8rement%2C%20l%E2%80%99id%C3%A9e%20est%20notamment%20que%20les%20aspects%20de%20l%E2%80%99outil%20qui%20ne%20suscitaient%20pas%20beaucoup%20d%E2%80%99engagement%20de%20la%20part%20des%20utilisateurs%20et%20qui%20n%E2%80%99%C3%A9taient%20pas%20vraiment%20pl%C3%A9biscit%C3%A9s%20disparaissent%20tandis%20que%20les%20fonctionnalit%C3%A9s%20qui%20suscitaient%20le%20plus%20d%E2%80%99int%C3%A9r%C3%AAt%20m%C3%A9tier%20%28et%20celles%20qui%20n%E2%80%99existaient%20pas%20encore%20mais%20qui%20%C3%A9taient%20tr%C3%A8s%20attendues%29%20soient%20am%C3%A9lior%C3%A9es%20%2F%20d%C3%A9velopp%C3%A9es.%0A%0A%23%202021%20%C3%A0%202023%20-%20Archives%0A%0A%23%23%20Le%20probl%C3%A8me%0A%0ALe%20champ%20de%20l%E2%80%99insertion%20sociale%20et%20professionnelle%2C%20et%20en%20particulier%20le%20domaine%20de%20l%E2%80%99accompagnement%20des%20usagers%2C%20se%20caract%C3%A9rise%20par%20une%20multiplicit%C3%A9%20et%20une%20grande%20diversit%C3%A9%20d%E2%80%99acteurs.%20La%20mauvaise%20connaissance%20et%20l%27absence%20de%20partage%20de%20certaines%20donn%C3%A9es%20ne%20permettent%20pas%20aux%20professionnels%20de%20proc%C3%A9der%20%C3%A0%20une%20bonne%20%C3%A9valuation%20des%20situations%20des%20usagers%20et%20un%20suivi%20optimal%20des%20parcours.%20Le%20d%C3%A9ficit%20de%20connaissance%20des%20%C3%A9l%C3%A9ments%20de%20parcours%20d%E2%80%99insertion%20d%E2%80%99un%20usager%20rend%20ainsi%20complexe%20l%E2%80%99analyse%20de%20sa%20situation%20et%20la%20mise%20en%20%C5%93uvre%20d%E2%80%99un%20parcours%20efficient%20entre%20partenaires.%20%0A%0A%23%23%20Notre%20service%0A%0AD%C3%A9velopp%C3%A9%20dans%20le%20cadre%20du%20volet%20num%C3%A9rique%20du%20projet%20de%20Service%20Public%20de%20l%27Insertion%20et%20de%20l%27Emploi%2C%20l%27outil%20Carnet%20de%20bord%20est%20un%20service%20public%20qui%20centralise%20les%20donn%C3%A9es%20essentielles%20%28%C3%A9l%C3%A9ments%20de%20diagnostic%20socio-professionnel%2C%20identit%C3%A9%20et%20contact%20des%20accompagnateurs%2C%20contrats%20de%20parcours%2C%20objectifs%20%C3%A0%20atteindre%20et%20actions%20initi%C3%A9es%2C%20historique%20de%20parcours%29%20en%20une%20seule%20page.%20Il%20regroupe%20l%E2%80%99information%20dans%20un%20espace%20s%C3%A9curis%C3%A9%20permettant%20un%20%C3%A9change%20accru%20des%20donn%C3%A9es%20essentielles%2C%20entre%20les%20accompagnateurs%20et%20le%20b%C3%A9n%C3%A9ficiaire%20afin%20d%E2%80%99amplifier%20la%20coordination%20et%20fluidifier%20le%20parcours%20d%E2%80%99un%20usager%20%21%0A%0A%23%23%20Nos%20publics%0A%0A%2A%2AQui%20sont%20les%20usagers%20en%20insertion%20concern%C3%A9s%20par%20l%27outil%20%3F%2A%2A%20Carnet%20de%20bord%20propose%20la%20cr%C3%A9ation%20de%20%22carnets%22%20d%27usagers%20relevant%20de%20diff%C3%A9rents%20publics%20en%20insertion%20%C3%A0%20l%27instar%20des%20b%C3%A9n%C3%A9ficiaires%20du%20RSA%2C%20des%20demandeurs%20d%27emploi%20%28notamment%20longue%20dur%C3%A9e%2C%20accompagnement%20global%20ou%20concern%C3%A9s%20par%20la%20modalit%C3%A9%20d%27accompagnement%20%22expert%20handicap%22%29%2C%20des%20jeunes%20NEET%2C%20etc.%20%0A%0A%2A%2AQui%20sont%20les%20professionnels%20concern%C3%A9s%20par%20l%27outil%20%3F%2A%2A%20Tous%20les%20accompagnateurs%20des%20personnes%20en%20insertion%20sont%20en%20mesure%20de%20b%C3%A9n%C3%A9ficier%20d%27un%20acc%C3%A8s%20aux%20carnets%20des%20usagers%20qu%27ils%20accompagnent.%20Cela%20concerne%20tant%20les%20accompagnateurs%20publics%20%28P%C3%B4le%20emploi%2C%20Conseils%20d%C3%A9partementaux%2C%20CCAS%2FCIAS%2C%20missions%20locales%2C%20Cap%20emploi%2C%20etc.%29%20que%20les%20acteurs%20priv%C3%A9s%20de%20l%27insertion%20comme%2C%20par%20exemple%2C%20les%20structures%20associatives%20d%C3%A9l%C3%A9gu%C3%A9es%20pour%20l%27accompagnement%20de%20b%C3%A9n%C3%A9ficiaires%20du%20RSA.%20L%27acc%C3%A8s%20de%20tous%20ces%20acteurs%20%C3%A0%20l%27outil%20a%20%C3%A9t%C3%A9%20rendu%20possible%20par%20un%20travail%20juridique%2C%20notamment%20concr%C3%A9tis%C3%A9%20par%20l%27entr%C3%A9e%20en%20vigueur%20de%20l%27%5Barticle%20168%5D%28https%3A%2F%2Fwww.legifrance.gouv.fr%2Fjorf%2Farticle_jo%2FJORFARTI000045197621%23%3A~%3Atext%3D%25C2%25AB%2520La%2520personne%2520dont%2520les%2520informations%2C%25C3%25A0%2520la%2520poursuite%2520du%2520traitement%29%20de%20la%20loi%20du%2021%20f%C3%A9vrier%202022%20relative%20%C3%A0%20la%20diff%C3%A9renciation%2C%20la%20d%C3%A9centralisation%2C%20la%20d%C3%A9concentration%20et%20portant%20diverses%20mesures%20de%20simplification%20de%20l%27action%20publique%20locale%20dont%20le%20%5Bd%C3%A9cret%20d%27application%20n%C2%B0%202023-188%5D%28https%3A%2F%2Fwww.legifrance.gouv.fr%2Fjorf%2Fid%2FJORFTEXT000047318824%29%20est%20paru%2017%20mars%202023.%20%0A"
, "events": [
]
, "phases": [
{ "name": "investigation", "start": "2021-01-25", "end": "2021-05-06"},
{ "name": "construction", "start": "2021-05-06", "end": "2021-10-31"},
{ "name": "acceleration", "start": "2021-11-01", "end": "2022-04-30"},
{ "name": "alumni", "start": "2023-12-01", "end": ""}
]
, "sponsors": [
"pole-emploi",
"mtei"
]
, "analyse_risques": "true"
, "analyse_risques_url": "https://pad.incubateur.net/s/e1H5QYiQ9"
, "dashlord_url": "https://dashlord.incubateur.net/url/carnet-de-bord-fabrique-social-gouv-fr/"
, "accessibility_status": "non conforme"
}
, "relationships":
{ "incubator":
Expand Down
27 changes: 27 additions & 0 deletions services/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,30 @@ def test_view_services_list(self):
self.assertEqual(response.status_code, 200)
self.assertContains(response, service_success.beta_name)
self.assertNotContains(response, service_alumni.beta_name)

@respx.mock
def test_syncbetadata_alumni_services_deleted(self):
out = StringIO()
err = StringIO()

_ = ContentPageFactory(slug="nos-services")

alumni_slug = "carnet.de.bord"
ServicePageFactory(beta_id=alumni_slug)
self.assertEqual(ServicePage.objects.count(), 1)

management.call_command(
"syncbetadata",
stdout=out,
stderr=err,
)

# Output look well
self.assertIn("Getting data completed : 4 services and 36 members synchronized", out.getvalue())
self.assertEqual(err.getvalue(), "")
self.assertIn("Service deleted!", out.getvalue())

# In DB, the account is good
self.assertEqual(ServicePage.objects.count(), 4)
self.assertEqual(Member.objects.count(), 36)
self.assertFalse(ServicePage.objects.filter(beta_id=alumni_slug).exists())

0 comments on commit 3842250

Please sign in to comment.