diff --git a/itou/templates/apply/submit/application/base.html b/itou/templates/apply/submit/application/base.html index 87f403af3b..9da30caaea 100644 --- a/itou/templates/apply/submit/application/base.html +++ b/itou/templates/apply/submit/application/base.html @@ -38,7 +38,7 @@

{% include 'apply/includes/_submit_title.html' %}

Dernière actualisation du profil : {{ job_seeker.last_checked_at|date }} à {{ job_seeker.last_checked_at|time }} {% if can_view_personal_information and not request.user.is_job_seeker %} - Vérifier le profil + Vérifier le profil {% endif %} {% if new_check_needed %}{% endif %}

diff --git a/itou/templates/job_seekers_views/check_job_seeker_info_for_hire.html b/itou/templates/job_seekers_views/check_job_seeker_info_for_hire.html index f3408b62d8..4b283d55df 100644 --- a/itou/templates/job_seekers_views/check_job_seeker_info_for_hire.html +++ b/itou/templates/job_seekers_views/check_job_seeker_info_for_hire.html @@ -14,7 +14,8 @@

Informations personnelles - Mettre à jour + Mettre à jour

{% include "apply/includes/profile_infos.html" %} diff --git a/itou/www/apply/views/submit_views.py b/itou/www/apply/views/submit_views.py index 393f6e8ba6..6ff1f98b99 100644 --- a/itou/www/apply/views/submit_views.py +++ b/itou/www/apply/views/submit_views.py @@ -227,7 +227,7 @@ def setup(self, request, *args, **kwargs): self.sender = request.user def dispatch(self, request, *args, **kwargs): - if self.sender.is_authenticated and self.sender.kind not in [UserKind.PRESCRIBER, UserKind.EMPLOYER]: + if self.sender.kind not in [UserKind.PRESCRIBER, UserKind.EMPLOYER]: logger.info(f"dispatch ({request.path}) : {self.sender.kind} in sender tunnel") return HttpResponseRedirect(reverse("apply:start", kwargs={"company_pk": self.company.pk})) return super().dispatch(request, *args, **kwargs) diff --git a/itou/www/job_seekers_views/urls.py b/itou/www/job_seekers_views/urls.py index 2f51cb0a68..30d6f506bb 100644 --- a/itou/www/job_seekers_views/urls.py +++ b/itou/www/job_seekers_views/urls.py @@ -72,27 +72,28 @@ name="create_job_seeker_step_end_for_hire", kwargs={"hire_process": True}, ), + # TODO(ewen): deprecated URLs path( "/hire/update//1", - views.UpdateJobSeekerStep1View.as_view(), + views.DeprecatedUpdateJobSeekerStep1View.as_view(), name="update_job_seeker_step_1_for_hire", kwargs={"hire_process": True}, ), path( "/hire/update//2", - views.UpdateJobSeekerStep2View.as_view(), + views.DeprecatedUpdateJobSeekerStep2View.as_view(), name="update_job_seeker_step_2_for_hire", kwargs={"hire_process": True}, ), path( "/hire/update//3", - views.UpdateJobSeekerStep3View.as_view(), + views.DeprecatedUpdateJobSeekerStep3View.as_view(), name="update_job_seeker_step_3_for_hire", kwargs={"hire_process": True}, ), path( "/hire/update//end", - views.UpdateJobSeekerStepEndView.as_view(), + views.DeprecatedUpdateJobSeekerStepEndView.as_view(), name="update_job_seeker_step_end_for_hire", kwargs={"hire_process": True}, ), @@ -110,25 +111,51 @@ ), # Job seeker check/updates path( - "/update//1", + "update/start", + views.UpdateJobSeekerStartView.as_view(), + name="update_job_seeker_start", + ), + path( + "update//1", views.UpdateJobSeekerStep1View.as_view(), name="update_job_seeker_step_1", ), path( - "/update//2", + "update//2", views.UpdateJobSeekerStep2View.as_view(), name="update_job_seeker_step_2", ), path( - "/update//3", + "update//3", views.UpdateJobSeekerStep3View.as_view(), name="update_job_seeker_step_3", ), path( - "/update//end", + "update//end", views.UpdateJobSeekerStepEndView.as_view(), name="update_job_seeker_step_end", ), + # TODO(ewen): deprecated URLs + path( + "/update//1", + views.DeprecatedUpdateJobSeekerStep1View.as_view(), + name="update_job_seeker_step_1", + ), + path( + "/update//2", + views.DeprecatedUpdateJobSeekerStep2View.as_view(), + name="update_job_seeker_step_2", + ), + path( + "/update//3", + views.DeprecatedUpdateJobSeekerStep3View.as_view(), + name="update_job_seeker_step_3", + ), + path( + "/update//end", + views.DeprecatedUpdateJobSeekerStepEndView.as_view(), + name="update_job_seeker_step_end", + ), # Common path( "/create//check-infos", diff --git a/itou/www/job_seekers_views/views.py b/itou/www/job_seekers_views/views.py index e7a04b2e40..3a8102132e 100644 --- a/itou/www/job_seekers_views/views.py +++ b/itou/www/job_seekers_views/views.py @@ -12,7 +12,7 @@ from django.urls import reverse from django.utils import timezone from django.utils.html import format_html -from django.views.generic import DetailView, ListView, TemplateView +from django.views.generic import DetailView, ListView, TemplateView, View from itou.companies import enums as companies_enums from itou.companies.enums import CompanyKind @@ -185,6 +185,8 @@ def get_queryset(self): class JobSeekerBaseView(TemplateView): + EXPECTED_SESSION_KIND = None + def __init__(self): super().__init__() self.company = None @@ -198,6 +200,11 @@ def setup(self, request, *args, session_uuid, hire_process=False, **kwargs): self.job_seeker_session = SessionNamespace(request.session, session_uuid) if not self.job_seeker_session.exists(): raise Http404 + # Ensure we are performing the action (update, create…) the session was created for. + if ( + session_kind := self.job_seeker_session.get("config").get("session_kind") + ) and session_kind != self.EXPECTED_SESSION_KIND: + raise Http404 self.is_gps = "gps" in request.GET and request.GET["gps"] == "true" if company_pk := self.job_seeker_session.get("apply", {}).get("company_pk"): self.company = ( @@ -261,7 +268,7 @@ def setup(self, request, *args, **kwargs): self.sender = request.user def dispatch(self, request, *args, **kwargs): - if self.sender.is_authenticated and self.sender.kind not in [UserKind.PRESCRIBER, UserKind.EMPLOYER]: + if self.sender.kind not in [UserKind.PRESCRIBER, UserKind.EMPLOYER]: logger.info(f"dispatch ({request.path}) : {self.sender.kind} in sender tunnel") return HttpResponseRedirect(reverse("apply:start", kwargs={"company_pk": self.company.pk})) return super().dispatch(request, *args, **kwargs) @@ -269,6 +276,7 @@ def dispatch(self, request, *args, **kwargs): class CheckNIRForJobSeekerView(JobSeekerBaseView): template_name = "job_seekers_views/step_check_job_seeker_nir.html" + EXPECTED_SESSION_KIND = "job-seeker-get-or-create-job-seeker" def __init__(self): super().__init__() @@ -289,6 +297,9 @@ def dispatch(self, request, *args, **kwargs): def get(self, request, *args, **kwargs): # The NIR already exists, go to next step if self.job_seeker.jobseeker_profile.nir: + # TODO(ewen): check_job_seeker_info doesn't use the session yet, + # so we delete the session here. + self.job_seeker_session.delete() return HttpResponseRedirect( reverse( "job_seekers_views:check_job_seeker_info", @@ -303,6 +314,9 @@ def post(self, request, *args, **kwargs): self.job_seeker.jobseeker_profile.nir = self.form.cleaned_data["nir"] self.job_seeker.jobseeker_profile.lack_of_nir_reason = "" self.job_seeker.jobseeker_profile.save(update_fields=("nir", "lack_of_nir_reason")) + # TODO(ewen): check_job_seeker_info doesn't use the session yet, + # so we delete the session here. + self.job_seeker_session.delete() return self.redirect_to_check_infos(self.job_seeker.public_id) else: next_url = reverse( @@ -322,6 +336,7 @@ def get_context_data(self, **kwargs): class CheckNIRForSenderView(JobSeekerForSenderBaseView): template_name = "job_seekers_views/step_check_job_seeker_nir.html" + EXPECTED_SESSION_KIND = "job-seeker-get-or-create-sender" def __init__(self): super().__init__() @@ -749,7 +764,326 @@ def get_context_data(self, **kwargs): return super().get_context_data(**kwargs) | {"profile": self.profile, "progress": "80"} -class UpdateJobSeekerBaseView(SessionNamespaceRequiredMixin, ApplyStepBaseView): +class UpdateJobSeekerStartView(View): + def setup(self, request, *args, **kwargs): + super().setup(request, *args, **kwargs) + + try: + job_seeker = get_object_or_404( + User.objects.filter(kind=UserKind.JOB_SEEKER), public_id=request.GET.get("job_seeker") + ) + except ValidationError: + raise Http404("Aucun candidat n'a été trouvé") + + try: + company = get_object_or_404(Company.objects.with_has_active_members(), pk=request.GET.get("company")) + except ValueError: + raise Http404("Aucune entreprise n'a été trouvée") + + from_url = get_safe_url(request, "from_url", fallback_url=reverse("dashboard:index")) + + if request.user.is_job_seeker or not request.user.can_view_personal_information(job_seeker): + raise PermissionDenied("Votre utilisateur n'est pas autorisé à vérifier les informations de ce candidat") + + self.job_seeker_session = SessionNamespace.create_uuid_namespace( + request.session, + data={ + "config": {"from_url": from_url, "session_kind": "job-seeker-update"}, + "job_seeker_pk": job_seeker.pk, + "apply": {"company_pk": company.pk}, + }, + ) + + def get(self, request, *args, **kwargs): + return HttpResponseRedirect( + reverse( + "job_seekers_views:update_job_seeker_step_1", kwargs={"session_uuid": self.job_seeker_session.name} + ) + ) + + +class UpdateJobSeekerBaseView(JobSeekerBaseView): + EXPECTED_SESSION_KIND = "job-seeker-update" + + def __init__(self): + super().__init__() + self.job_seeker_session = None + + def get_job_seeker_queryset(self): + return User.objects.filter(kind=UserKind.JOB_SEEKER) + + def setup(self, request, *args, **kwargs): + super().setup(request, *args, **kwargs) + + self.job_seeker = get_object_or_404( + self.get_job_seeker_queryset(), pk=self.job_seeker_session.get("job_seeker_pk") + ) + if request.user.is_job_seeker or not request.user.can_view_personal_information(self.job_seeker): + # Since the link leading to this process isn't visible to those users, this should never happen + raise PermissionDenied("Votre utilisateur n'est pas autorisé à vérifier les informations de ce candidat") + + def get_context_data(self, **kwargs): + return super().get_context_data(**kwargs) | { + "update_job_seeker": True, + "job_seeker": self.job_seeker, + "step_3_url": reverse( + "job_seekers_views:update_job_seeker_step_3", + kwargs={"session_uuid": self.job_seeker_session.name}, + ), + "reset_url": self.get_reset_url(), + "readonly_form": False, + } + + def _disable_form(self): + for field in self.form: + field.field.disabled = True + + def get_reset_url(self): + return self.job_seeker_session.get("config").get("from_url") + + def get_back_url(self): + return reverse( + self.previous_url, + kwargs={"session_uuid": self.job_seeker_session.name}, + ) + + def get_next_url(self): + return reverse( + self.next_url, + kwargs={"session_uuid": self.job_seeker_session.name}, + ) + + +class UpdateJobSeekerStep1View(UpdateJobSeekerBaseView): + template_name = "job_seekers_views/create_or_update_job_seeker/step_1.html" + + next_url = "job_seekers_views:update_job_seeker_step_2" + + def __init__(self): + super().__init__() + self.form = None + + def get_job_seeker_queryset(self): + return super().get_job_seeker_queryset().select_related("jobseeker_profile") + + def setup(self, request, *args, **kwargs): + super().setup(request, *args, **kwargs) + if not self.job_seeker_session.get("user"): + self.job_seeker_session.set("user", {}) + session_nir = self.job_seeker_session.get("profile", {}).get("nir") + session_lack_of_nir_reason = self.job_seeker_session.get("profile", {}).get("lack_of_nir_reason") + + self.form = CreateOrUpdateJobSeekerStep1Form( + instance=self.job_seeker, + initial=self.job_seeker_session.get("user", {}) + | { + "nir": session_nir if session_nir is not None else self.job_seeker.jobseeker_profile.nir, + "lack_of_nir_reason": ( + session_lack_of_nir_reason + if session_lack_of_nir_reason is not None + else self.job_seeker.jobseeker_profile.lack_of_nir_reason + ), + }, + data=request.POST or None, + ) + if not self.request.user.can_edit_personal_information(self.job_seeker): + self._disable_form() + + def post(self, request, *args, **kwargs): + if not self.request.user.can_edit_personal_information(self.job_seeker): + return HttpResponseRedirect(self.get_next_url()) + if self.form.is_valid(): + self.job_seeker_session.set( + "user", + self.job_seeker_session.get("user", {}) | self.form.cleaned_data_without_profile_fields, + ) + self.job_seeker_session.set( + "profile", + self.job_seeker_session.get("profile", {}) | self.form.cleaned_data_from_profile_fields, + ) + return HttpResponseRedirect(self.get_next_url()) + + return self.render_to_response(self.get_context_data(**kwargs)) + + def get_back_url(self): + return self.get_reset_url() + + def get_context_data(self, **kwargs): + return super().get_context_data(**kwargs) | { + "confirmation_needed": False, + "form": self.form, + "matomo_form_name": "apply-update-job-seeker-identity", + "readonly_form": not self.request.user.can_edit_personal_information(self.job_seeker), + "progress": "20", + } + + +class UpdateJobSeekerStep2View(UpdateJobSeekerBaseView): + template_name = "job_seekers_views/create_or_update_job_seeker/step_2.html" + + previous_url = "job_seekers_views:update_job_seeker_step_1" + next_url = "job_seekers_views:update_job_seeker_step_3" + + def __init__(self): + super().__init__() + self.form = None + + def setup(self, request, *args, **kwargs): + super().setup(request, *args, **kwargs) + self.form = CreateOrUpdateJobSeekerStep2Form( + instance=self.job_seeker, + initial=self.job_seeker_session.get("user", {}), + data=request.POST or None, + ) + if not self.request.user.can_edit_personal_information(self.job_seeker): + self._disable_form() + + def post(self, request, *args, **kwargs): + if not self.request.user.can_edit_personal_information(self.job_seeker): + return HttpResponseRedirect(self.get_next_url()) + if self.form.is_valid(): + self.job_seeker_session.set("user", self.job_seeker_session.get("user") | self.form.cleaned_data) + return HttpResponseRedirect(self.get_next_url()) + + return self.render_to_response(self.get_context_data(**kwargs)) + + def get_context_data(self, **kwargs): + return super().get_context_data(**kwargs) | { + "form": self.form, + "readonly_form": not self.request.user.can_edit_personal_information(self.job_seeker), + "progress": "40", + } + + +class UpdateJobSeekerStep3View(UpdateJobSeekerBaseView): + template_name = "job_seekers_views/create_or_update_job_seeker/step_3.html" + + previous_url = "job_seekers_views:update_job_seeker_step_2" + next_url = "job_seekers_views:update_job_seeker_step_end" + + def __init__(self): + super().__init__() + self.form = None + + def get_job_seeker_queryset(self): + return super().get_job_seeker_queryset().select_related("jobseeker_profile") + + def setup(self, request, *args, **kwargs): + super().setup(request, *args, **kwargs) + + self.form = CreateOrUpdateJobSeekerStep3Form( + instance=self.job_seeker.jobseeker_profile if self.job_seeker.has_jobseeker_profile else None, + initial=self.job_seeker_session.get("profile", {}), + data=request.POST or None, + ) + + def post(self, request, *args, **kwargs): + if self.form.is_valid(): + self.job_seeker_session.set("profile", self.job_seeker_session.get("profile", {}) | self.form.cleaned_data) + return HttpResponseRedirect(self.get_next_url()) + + return self.render_to_response(self.get_context_data(**kwargs)) + + def get_context_data(self, **kwargs): + return super().get_context_data(**kwargs) | { + "form": self.form, + "progress": "60", + } + + +class UpdateJobSeekerStepEndView(UpdateJobSeekerBaseView): + template_name = "job_seekers_views/create_or_update_job_seeker/step_end.html" + + previous_url = "job_seekers_views:update_job_seeker_step_3" + + def __init__(self): + super().__init__() + self.profile = None + self.updated_user_fields = [] + + def _get_profile_data_from_session(self): + fields_to_exclude = [ + # Dummy fields used by CreateOrUpdateJobSeekerStep3Form() + "pole_emploi", + "pole_emploi_id_forgotten", + "rsa_allocation", + "unemployed", + "ass_allocation", + "aah_allocation", + "lack_of_nir", + # ForeignKeys - the session value will be the ID serialization and not the instance + "birth_place", + "birth_country", + ] + + birth_data = { + "birth_place_id": self.job_seeker_session.get("profile", {}).get("birth_place"), + "birth_country_id": self.job_seeker_session.get("profile", {}).get("birth_country"), + } + + return birth_data | { + k: v for k, v in self.job_seeker_session.get("profile", {}).items() if k not in fields_to_exclude + } + + def setup(self, request, *args, **kwargs): + super().setup(request, *args, **kwargs) + + allowed_user_fields_to_update = [] + if self.request.user.can_edit_personal_information(self.job_seeker): + allowed_user_fields_to_update.extend(CreateOrUpdateJobSeekerStep1Form.Meta.fields) + allowed_user_fields_to_update.extend(CreateOrUpdateJobSeekerStep2Form.Meta.fields) + + for field in allowed_user_fields_to_update: + if field in self.job_seeker_session.get("user", {}): + session_value = self.job_seeker_session.get("user")[field] + if session_value != getattr(self.job_seeker, field): + setattr(self.job_seeker, field, session_value) + self.updated_user_fields.append(field) + + if not self.job_seeker.has_jobseeker_profile: + self.profile = JobSeekerProfile( + user=self.job_seeker, + **self._get_profile_data_from_session(), + ) + else: + self.profile = self.job_seeker.jobseeker_profile + for k, v in self._get_profile_data_from_session().items(): + setattr(self.profile, k, v) + + @transaction.atomic + def post(self, request, *args, **kwargs): + self.updated_user_fields.append("last_checked_at") + try: + if "address_line_1" in self.updated_user_fields or "post_code" in self.updated_user_fields: + try: + self.job_seeker.geocode_address() + except AddressLookupError: + # Nothing to do: re-raised and already logged as error + pass + else: + self.updated_user_fields.extend(["coords", "geocoding_score"]) + self.job_seeker.last_checked_at = timezone.now() + self.job_seeker.save(update_fields=self.updated_user_fields) + except ValidationError as e: + messages.error(request, " ".join(e.messages)) + url = reverse( + "job_seekers_views:update_job_seeker_step_1", + kwargs={"session_uuid": self.job_seeker_session.name}, + ) + else: + self.profile.save() + url = self.get_next_url() + self.job_seeker_session.delete() + return HttpResponseRedirect(url) + + def get_next_url(self): + return self.job_seeker_session.get("config").get("from_url") + + def get_context_data(self, **kwargs): + return super().get_context_data(**kwargs) | {"profile": self.profile, "progress": "80"} + + +class DeprecatedUpdateJobSeekerBaseView(SessionNamespaceRequiredMixin, ApplyStepBaseView): def __init__(self): super().__init__() self.job_seeker_session = None @@ -801,7 +1135,7 @@ def get_next_url(self): ) -class UpdateJobSeekerStep1View(UpdateJobSeekerBaseView): +class DeprecatedUpdateJobSeekerStep1View(DeprecatedUpdateJobSeekerBaseView): template_name = "job_seekers_views/create_or_update_job_seeker/step_1.html" previous_apply_url = "apply:application_jobs" @@ -865,9 +1199,11 @@ def get_context_data(self, **kwargs): } -class UpdateJobSeekerStep2View(UpdateJobSeekerBaseView): +class DeprecatedUpdateJobSeekerStep2View(DeprecatedUpdateJobSeekerBaseView): template_name = "job_seekers_views/create_or_update_job_seeker/step_2.html" - required_session_namespaces = ["job_seeker_session"] + UpdateJobSeekerBaseView.required_session_namespaces + required_session_namespaces = [ + "job_seeker_session" + ] + DeprecatedUpdateJobSeekerBaseView.required_session_namespaces previous_apply_url = "job_seekers_views:update_job_seeker_step_1" previous_hire_url = "job_seekers_views:update_job_seeker_step_1_for_hire" @@ -905,9 +1241,11 @@ def get_context_data(self, **kwargs): } -class UpdateJobSeekerStep3View(UpdateJobSeekerBaseView): +class DeprecatedUpdateJobSeekerStep3View(DeprecatedUpdateJobSeekerBaseView): template_name = "job_seekers_views/create_or_update_job_seeker/step_3.html" - required_session_namespaces = ["job_seeker_session"] + UpdateJobSeekerBaseView.required_session_namespaces + required_session_namespaces = [ + "job_seeker_session" + ] + DeprecatedUpdateJobSeekerBaseView.required_session_namespaces previous_apply_url = "job_seekers_views:update_job_seeker_step_2" previous_hire_url = "job_seekers_views:update_job_seeker_step_2_for_hire" @@ -944,9 +1282,11 @@ def get_context_data(self, **kwargs): } -class UpdateJobSeekerStepEndView(UpdateJobSeekerBaseView): +class DeprecatedUpdateJobSeekerStepEndView(DeprecatedUpdateJobSeekerBaseView): template_name = "job_seekers_views/create_or_update_job_seeker/step_end.html" - required_session_namespaces = ["job_seeker_session"] + UpdateJobSeekerBaseView.required_session_namespaces + required_session_namespaces = [ + "job_seeker_session" + ] + DeprecatedUpdateJobSeekerBaseView.required_session_namespaces previous_apply_url = "job_seekers_views:update_job_seeker_step_3" previous_hire_url = "job_seekers_views:update_job_seeker_step_3_for_hire" diff --git a/tests/www/apply/__snapshots__/test_submit.ambr b/tests/www/apply/__snapshots__/test_submit.ambr index 96987aeb0a..a93341f06b 100644 --- a/tests/www/apply/__snapshots__/test_submit.ambr +++ b/tests/www/apply/__snapshots__/test_submit.ambr @@ -939,9 +939,9 @@ ]), }) # --- -# name: TestUpdateJobSeeker.test_as_authorized_prescriber_with_proxied_job_seeker[queries - step 1] +# name: TestUpdateJobSeeker.test_as_authorized_prescriber_with_proxied_job_seeker[queries - start] dict({ - 'num_queries': 12, + 'num_queries': 11, 'queries': list([ dict({ 'origin': list([ @@ -1059,8 +1059,7 @@ }), dict({ 'origin': list([ - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStartView.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT "users_user"."id", @@ -1094,45 +1093,8 @@ "users_user"."last_checked_at", "users_user"."public_id", "users_user"."address_filled_at", - "users_user"."first_login", - "users_jobseekerprofile"."user_id", - "users_jobseekerprofile"."birthdate", - "users_jobseekerprofile"."birth_place_id", - "users_jobseekerprofile"."birth_country_id", - "users_jobseekerprofile"."nir", - "users_jobseekerprofile"."lack_of_nir_reason", - "users_jobseekerprofile"."pole_emploi_id", - "users_jobseekerprofile"."lack_of_pole_emploi_id_reason", - "users_jobseekerprofile"."asp_uid", - "users_jobseekerprofile"."education_level", - "users_jobseekerprofile"."resourceless", - "users_jobseekerprofile"."rqth_employee", - "users_jobseekerprofile"."oeth_employee", - "users_jobseekerprofile"."pole_emploi_since", - "users_jobseekerprofile"."unemployed_since", - "users_jobseekerprofile"."has_rsa_allocation", - "users_jobseekerprofile"."rsa_allocation_since", - "users_jobseekerprofile"."ass_allocation_since", - "users_jobseekerprofile"."aah_allocation_since", - "users_jobseekerprofile"."are_allocation_since", - "users_jobseekerprofile"."activity_bonus_since", - "users_jobseekerprofile"."cape_freelance", - "users_jobseekerprofile"."cesa_freelance", - "users_jobseekerprofile"."actor_met_for_business_creation", - "users_jobseekerprofile"."mean_monthly_income_before_process", - "users_jobseekerprofile"."eiti_contributions", - "users_jobseekerprofile"."hexa_lane_number", - "users_jobseekerprofile"."hexa_std_extension", - "users_jobseekerprofile"."hexa_non_std_extension", - "users_jobseekerprofile"."hexa_lane_type", - "users_jobseekerprofile"."hexa_lane_name", - "users_jobseekerprofile"."hexa_additional_address", - "users_jobseekerprofile"."hexa_post_code", - "users_jobseekerprofile"."hexa_commune_id", - "users_jobseekerprofile"."pe_obfuscated_nir", - "users_jobseekerprofile"."pe_last_certification_attempt_at" + "users_user"."first_login" FROM "users_user" - LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") WHERE ("users_user"."kind" = %s AND "users_user"."public_id" = %s) LIMIT 21 @@ -1140,30 +1102,7 @@ }), dict({ 'origin': list([ - 'User.is_prescriber_with_authorized_org[users/models.py]', - 'User.can_edit_personal_information[users/models.py]', - 'User.can_view_personal_information[users/models.py]', - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT %s AS "a" - FROM "prescribers_prescribermembership" - INNER JOIN "users_user" ON ("prescribers_prescribermembership"."user_id" = "users_user"."id") - INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") - WHERE ("prescribers_prescribermembership"."user_id" = %s - AND "prescribers_prescribermembership"."is_active" - AND "prescribers_prescriberorganization"."is_authorized" - AND "users_user"."is_active") - LIMIT 1 - ''', - }), - dict({ - 'origin': list([ - 'UpdateJobSeekerStep1View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep1View.setup[utils/session.py]', - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStartView.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT "companies_company"."id", @@ -1215,29 +1154,28 @@ }), dict({ 'origin': list([ - 'Atomic.__exit__[/django/db/transaction.py]', + 'User.is_prescriber_with_authorized_org[users/models.py]', + 'User.can_edit_personal_information[users/models.py]', + 'User.can_view_personal_information[users/models.py]', + 'UpdateJobSeekerStartView.setup[www/job_seekers_views/views.py]', ]), - 'sql': 'RELEASE SAVEPOINT ""', + 'sql': ''' + SELECT %s AS "a" + FROM "prescribers_prescribermembership" + INNER JOIN "users_user" ON ("prescribers_prescribermembership"."user_id" = "users_user"."id") + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active" + AND "prescribers_prescriberorganization"."is_authorized" + AND "users_user"."is_active") + LIMIT 1 + ''', }), dict({ 'origin': list([ - 'CustomFieldRenderer.render[utils/custom_renderer.py]', - 'SimpleNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', - 'IfNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', - 'BlockNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', - 'BlockNode[layout/base.html]', - 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', - 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', + 'Atomic.__exit__[/django/db/transaction.py]', ]), - 'sql': ''' - SELECT "asp_country"."id", - "asp_country"."code", - "asp_country"."name", - "asp_country"."group", - "asp_country"."department" - FROM "asp_country" - ORDER BY "asp_country"."name" ASC - ''', + 'sql': 'RELEASE SAVEPOINT ""', }), dict({ 'origin': list([ @@ -1268,9 +1206,9 @@ ]), }) # --- -# name: TestUpdateJobSeeker.test_as_authorized_prescriber_with_proxied_job_seeker[queries - step 2] +# name: TestUpdateJobSeeker.test_as_authorized_prescriber_with_proxied_job_seeker[queries - step 1] dict({ - 'num_queries': 8, + 'num_queries': 13, 'queries': list([ dict({ 'origin': list([ @@ -1286,6 +1224,20 @@ LIMIT 21 ''', }), + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), dict({ 'origin': list([ 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', @@ -1388,74 +1340,9 @@ }), dict({ 'origin': list([ - 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT "users_user"."id", - "users_user"."password", - "users_user"."last_login", - "users_user"."is_superuser", - "users_user"."username", - "users_user"."first_name", - "users_user"."last_name", - "users_user"."is_staff", - "users_user"."is_active", - "users_user"."date_joined", - "users_user"."address_line_1", - "users_user"."address_line_2", - "users_user"."post_code", - "users_user"."city", - "users_user"."department", - "users_user"."coords", - "users_user"."geocoding_score", - "users_user"."geocoding_updated_at", - "users_user"."ban_api_resolved_address", - "users_user"."insee_city_id", - "users_user"."title", - "users_user"."email", - "users_user"."phone", - "users_user"."kind", - "users_user"."identity_provider", - "users_user"."has_completed_welcoming_tour", - "users_user"."created_by_id", - "users_user"."external_data_source_history", - "users_user"."last_checked_at", - "users_user"."public_id", - "users_user"."address_filled_at", - "users_user"."first_login" - FROM "users_user" - WHERE ("users_user"."kind" = %s - AND "users_user"."public_id" = %s) - LIMIT 21 - ''', - }), - dict({ - 'origin': list([ - 'User.is_prescriber_with_authorized_org[users/models.py]', - 'User.can_edit_personal_information[users/models.py]', - 'User.can_view_personal_information[users/models.py]', - 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT %s AS "a" - FROM "prescribers_prescribermembership" - INNER JOIN "users_user" ON ("prescribers_prescribermembership"."user_id" = "users_user"."id") - INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") - WHERE ("prescribers_prescribermembership"."user_id" = %s - AND "prescribers_prescribermembership"."is_active" - AND "prescribers_prescriberorganization"."is_authorized" - AND "users_user"."is_active") - LIMIT 1 - ''', - }), - dict({ - 'origin': list([ - 'UpdateJobSeekerStep2View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep2View.setup[utils/session.py]', - 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT "companies_company"."id", @@ -1507,34 +1394,8 @@ }), dict({ 'origin': list([ - 'Atomic.__exit__[/django/db/transaction.py]', - ]), - 'sql': 'RELEASE SAVEPOINT ""', - }), - ]), - }) -# --- -# name: TestUpdateJobSeeker.test_as_authorized_prescriber_with_proxied_job_seeker[queries - step 3] - dict({ - 'num_queries': 8, - 'queries': list([ - dict({ - 'origin': list([ - 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', - ]), - 'sql': ''' - SELECT "django_session"."session_key", - "django_session"."session_data", - "django_session"."expire_date" - FROM "django_session" - WHERE ("django_session"."expire_date" > %s - AND "django_session"."session_key" = %s) - LIMIT 21 - ''', - }), - dict({ - 'origin': list([ - 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT "users_user"."id", @@ -1568,11 +1429,198 @@ "users_user"."last_checked_at", "users_user"."public_id", "users_user"."address_filled_at", - "users_user"."first_login" + "users_user"."first_login", + "users_jobseekerprofile"."user_id", + "users_jobseekerprofile"."birthdate", + "users_jobseekerprofile"."birth_place_id", + "users_jobseekerprofile"."birth_country_id", + "users_jobseekerprofile"."nir", + "users_jobseekerprofile"."lack_of_nir_reason", + "users_jobseekerprofile"."pole_emploi_id", + "users_jobseekerprofile"."lack_of_pole_emploi_id_reason", + "users_jobseekerprofile"."asp_uid", + "users_jobseekerprofile"."education_level", + "users_jobseekerprofile"."resourceless", + "users_jobseekerprofile"."rqth_employee", + "users_jobseekerprofile"."oeth_employee", + "users_jobseekerprofile"."pole_emploi_since", + "users_jobseekerprofile"."unemployed_since", + "users_jobseekerprofile"."has_rsa_allocation", + "users_jobseekerprofile"."rsa_allocation_since", + "users_jobseekerprofile"."ass_allocation_since", + "users_jobseekerprofile"."aah_allocation_since", + "users_jobseekerprofile"."are_allocation_since", + "users_jobseekerprofile"."activity_bonus_since", + "users_jobseekerprofile"."cape_freelance", + "users_jobseekerprofile"."cesa_freelance", + "users_jobseekerprofile"."actor_met_for_business_creation", + "users_jobseekerprofile"."mean_monthly_income_before_process", + "users_jobseekerprofile"."eiti_contributions", + "users_jobseekerprofile"."hexa_lane_number", + "users_jobseekerprofile"."hexa_std_extension", + "users_jobseekerprofile"."hexa_non_std_extension", + "users_jobseekerprofile"."hexa_lane_type", + "users_jobseekerprofile"."hexa_lane_name", + "users_jobseekerprofile"."hexa_additional_address", + "users_jobseekerprofile"."hexa_post_code", + "users_jobseekerprofile"."hexa_commune_id", + "users_jobseekerprofile"."pe_obfuscated_nir", + "users_jobseekerprofile"."pe_last_certification_attempt_at" FROM "users_user" - WHERE "users_user"."id" = %s - LIMIT 21 - ''', + LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") + WHERE ("users_user"."kind" = %s + AND "users_user"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'User.is_prescriber_with_authorized_org[users/models.py]', + 'User.can_edit_personal_information[users/models.py]', + 'User.can_view_personal_information[users/models.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT %s AS "a" + FROM "prescribers_prescribermembership" + INNER JOIN "users_user" ON ("prescribers_prescribermembership"."user_id" = "users_user"."id") + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active" + AND "prescribers_prescriberorganization"."is_authorized" + AND "users_user"."is_active") + LIMIT 1 + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'CustomFieldRenderer.render[utils/custom_renderer.py]', + 'SimpleNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', + 'IfNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', + 'BlockNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', + 'BlockNode[layout/base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', + ]), + 'sql': ''' + SELECT "asp_country"."id", + "asp_country"."code", + "asp_country"."name", + "asp_country"."group", + "asp_country"."department" + FROM "asp_country" + ORDER BY "asp_country"."name" ASC + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'Session.save[/django/db/models/base.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + UPDATE "django_session" + SET "session_data" = %s, + "expire_date" = %s + WHERE "django_session"."session_key" = %s + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + ]), + }) +# --- +# name: TestUpdateJobSeeker.test_as_authorized_prescriber_with_proxied_job_seeker[queries - step 2] + dict({ + 'num_queries': 9, + 'queries': list([ + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE "users_user"."id" = %s + LIMIT 21 + ''', }), dict({ 'origin': list([ @@ -1634,8 +1682,62 @@ }), dict({ 'origin': list([ - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT "users_user"."id", @@ -1669,45 +1771,7984 @@ "users_user"."last_checked_at", "users_user"."public_id", "users_user"."address_filled_at", - "users_user"."first_login", - "users_jobseekerprofile"."user_id", - "users_jobseekerprofile"."birthdate", - "users_jobseekerprofile"."birth_place_id", - "users_jobseekerprofile"."birth_country_id", - "users_jobseekerprofile"."nir", - "users_jobseekerprofile"."lack_of_nir_reason", - "users_jobseekerprofile"."pole_emploi_id", - "users_jobseekerprofile"."lack_of_pole_emploi_id_reason", - "users_jobseekerprofile"."asp_uid", - "users_jobseekerprofile"."education_level", - "users_jobseekerprofile"."resourceless", - "users_jobseekerprofile"."rqth_employee", - "users_jobseekerprofile"."oeth_employee", - "users_jobseekerprofile"."pole_emploi_since", - "users_jobseekerprofile"."unemployed_since", - "users_jobseekerprofile"."has_rsa_allocation", - "users_jobseekerprofile"."rsa_allocation_since", - "users_jobseekerprofile"."ass_allocation_since", - "users_jobseekerprofile"."aah_allocation_since", - "users_jobseekerprofile"."are_allocation_since", - "users_jobseekerprofile"."activity_bonus_since", - "users_jobseekerprofile"."cape_freelance", - "users_jobseekerprofile"."cesa_freelance", - "users_jobseekerprofile"."actor_met_for_business_creation", - "users_jobseekerprofile"."mean_monthly_income_before_process", - "users_jobseekerprofile"."eiti_contributions", - "users_jobseekerprofile"."hexa_lane_number", - "users_jobseekerprofile"."hexa_std_extension", - "users_jobseekerprofile"."hexa_non_std_extension", - "users_jobseekerprofile"."hexa_lane_type", - "users_jobseekerprofile"."hexa_lane_name", - "users_jobseekerprofile"."hexa_additional_address", - "users_jobseekerprofile"."hexa_post_code", - "users_jobseekerprofile"."hexa_commune_id", - "users_jobseekerprofile"."pe_obfuscated_nir", - "users_jobseekerprofile"."pe_last_certification_attempt_at" + "users_user"."first_login" + FROM "users_user" + WHERE ("users_user"."kind" = %s + AND "users_user"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'User.is_prescriber_with_authorized_org[users/models.py]', + 'User.can_edit_personal_information[users/models.py]', + 'User.can_view_personal_information[users/models.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT %s AS "a" + FROM "prescribers_prescribermembership" + INNER JOIN "users_user" ON ("prescribers_prescribermembership"."user_id" = "users_user"."id") + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active" + AND "prescribers_prescriberorganization"."is_authorized" + AND "users_user"."is_active") + LIMIT 1 + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + ]), + }) +# --- +# name: TestUpdateJobSeeker.test_as_authorized_prescriber_with_proxied_job_seeker[queries - step 3] + dict({ + 'num_queries': 9, + 'queries': list([ + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE "users_user"."id" = %s + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "prescribers_prescribermembership"."id", + "prescribers_prescribermembership"."user_id", + "prescribers_prescribermembership"."joined_at", + "prescribers_prescribermembership"."is_admin", + "prescribers_prescribermembership"."is_active", + "prescribers_prescribermembership"."created_at", + "prescribers_prescribermembership"."updated_at", + "prescribers_prescribermembership"."organization_id", + "prescribers_prescribermembership"."updated_by_id", + "prescribers_prescriberorganization"."id", + "prescribers_prescriberorganization"."address_line_1", + "prescribers_prescriberorganization"."address_line_2", + "prescribers_prescriberorganization"."post_code", + "prescribers_prescriberorganization"."city", + "prescribers_prescriberorganization"."department", + "prescribers_prescriberorganization"."coords", + "prescribers_prescriberorganization"."geocoding_score", + "prescribers_prescriberorganization"."geocoding_updated_at", + "prescribers_prescriberorganization"."ban_api_resolved_address", + "prescribers_prescriberorganization"."insee_city_id", + "prescribers_prescriberorganization"."name", + "prescribers_prescriberorganization"."created_at", + "prescribers_prescriberorganization"."updated_at", + "prescribers_prescriberorganization"."uid", + "prescribers_prescriberorganization"."active_members_email_reminder_last_sent_at", + "prescribers_prescriberorganization"."automatic_geocoding_update", + "prescribers_prescriberorganization"."siret", + "prescribers_prescriberorganization"."is_head_office", + "prescribers_prescriberorganization"."kind", + "prescribers_prescriberorganization"."is_brsa", + "prescribers_prescriberorganization"."phone", + "prescribers_prescriberorganization"."email", + "prescribers_prescriberorganization"."website", + "prescribers_prescriberorganization"."description", + "prescribers_prescriberorganization"."is_authorized", + "prescribers_prescriberorganization"."code_safir_pole_emploi", + "prescribers_prescriberorganization"."created_by_id", + "prescribers_prescriberorganization"."authorization_status", + "prescribers_prescriberorganization"."authorization_updated_at", + "prescribers_prescriberorganization"."authorization_updated_by_id" + FROM "prescribers_prescribermembership" + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active") + ORDER BY "prescribers_prescribermembership"."created_at" ASC + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login", + "users_jobseekerprofile"."user_id", + "users_jobseekerprofile"."birthdate", + "users_jobseekerprofile"."birth_place_id", + "users_jobseekerprofile"."birth_country_id", + "users_jobseekerprofile"."nir", + "users_jobseekerprofile"."lack_of_nir_reason", + "users_jobseekerprofile"."pole_emploi_id", + "users_jobseekerprofile"."lack_of_pole_emploi_id_reason", + "users_jobseekerprofile"."asp_uid", + "users_jobseekerprofile"."education_level", + "users_jobseekerprofile"."resourceless", + "users_jobseekerprofile"."rqth_employee", + "users_jobseekerprofile"."oeth_employee", + "users_jobseekerprofile"."pole_emploi_since", + "users_jobseekerprofile"."unemployed_since", + "users_jobseekerprofile"."has_rsa_allocation", + "users_jobseekerprofile"."rsa_allocation_since", + "users_jobseekerprofile"."ass_allocation_since", + "users_jobseekerprofile"."aah_allocation_since", + "users_jobseekerprofile"."are_allocation_since", + "users_jobseekerprofile"."activity_bonus_since", + "users_jobseekerprofile"."cape_freelance", + "users_jobseekerprofile"."cesa_freelance", + "users_jobseekerprofile"."actor_met_for_business_creation", + "users_jobseekerprofile"."mean_monthly_income_before_process", + "users_jobseekerprofile"."eiti_contributions", + "users_jobseekerprofile"."hexa_lane_number", + "users_jobseekerprofile"."hexa_std_extension", + "users_jobseekerprofile"."hexa_non_std_extension", + "users_jobseekerprofile"."hexa_lane_type", + "users_jobseekerprofile"."hexa_lane_name", + "users_jobseekerprofile"."hexa_additional_address", + "users_jobseekerprofile"."hexa_post_code", + "users_jobseekerprofile"."hexa_commune_id", + "users_jobseekerprofile"."pe_obfuscated_nir", + "users_jobseekerprofile"."pe_last_certification_attempt_at" + FROM "users_user" + LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") + WHERE ("users_user"."kind" = %s + AND "users_user"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'User.is_prescriber_with_authorized_org[users/models.py]', + 'User.can_edit_personal_information[users/models.py]', + 'User.can_view_personal_information[users/models.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT %s AS "a" + FROM "prescribers_prescribermembership" + INNER JOIN "users_user" ON ("prescribers_prescribermembership"."user_id" = "users_user"."id") + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active" + AND "prescribers_prescriberorganization"."is_authorized" + AND "users_user"."is_active") + LIMIT 1 + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + ]), + }) +# --- +# name: TestUpdateJobSeeker.test_as_authorized_prescriber_with_proxied_job_seeker_deprecated[queries - step 2] + dict({ + 'num_queries': 8, + 'queries': list([ + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE "users_user"."id" = %s + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "prescribers_prescribermembership"."id", + "prescribers_prescribermembership"."user_id", + "prescribers_prescribermembership"."joined_at", + "prescribers_prescribermembership"."is_admin", + "prescribers_prescribermembership"."is_active", + "prescribers_prescribermembership"."created_at", + "prescribers_prescribermembership"."updated_at", + "prescribers_prescribermembership"."organization_id", + "prescribers_prescribermembership"."updated_by_id", + "prescribers_prescriberorganization"."id", + "prescribers_prescriberorganization"."address_line_1", + "prescribers_prescriberorganization"."address_line_2", + "prescribers_prescriberorganization"."post_code", + "prescribers_prescriberorganization"."city", + "prescribers_prescriberorganization"."department", + "prescribers_prescriberorganization"."coords", + "prescribers_prescriberorganization"."geocoding_score", + "prescribers_prescriberorganization"."geocoding_updated_at", + "prescribers_prescriberorganization"."ban_api_resolved_address", + "prescribers_prescriberorganization"."insee_city_id", + "prescribers_prescriberorganization"."name", + "prescribers_prescriberorganization"."created_at", + "prescribers_prescriberorganization"."updated_at", + "prescribers_prescriberorganization"."uid", + "prescribers_prescriberorganization"."active_members_email_reminder_last_sent_at", + "prescribers_prescriberorganization"."automatic_geocoding_update", + "prescribers_prescriberorganization"."siret", + "prescribers_prescriberorganization"."is_head_office", + "prescribers_prescriberorganization"."kind", + "prescribers_prescriberorganization"."is_brsa", + "prescribers_prescriberorganization"."phone", + "prescribers_prescriberorganization"."email", + "prescribers_prescriberorganization"."website", + "prescribers_prescriberorganization"."description", + "prescribers_prescriberorganization"."is_authorized", + "prescribers_prescriberorganization"."code_safir_pole_emploi", + "prescribers_prescriberorganization"."created_by_id", + "prescribers_prescriberorganization"."authorization_status", + "prescribers_prescriberorganization"."authorization_updated_at", + "prescribers_prescriberorganization"."authorization_updated_by_id" + FROM "prescribers_prescribermembership" + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active") + ORDER BY "prescribers_prescribermembership"."created_at" ASC + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'DeprecatedUpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE ("users_user"."kind" = %s + AND "users_user"."public_id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'User.is_prescriber_with_authorized_org[users/models.py]', + 'User.can_edit_personal_information[users/models.py]', + 'User.can_view_personal_information[users/models.py]', + 'DeprecatedUpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT %s AS "a" + FROM "prescribers_prescribermembership" + INNER JOIN "users_user" ON ("prescribers_prescribermembership"."user_id" = "users_user"."id") + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active" + AND "prescribers_prescriberorganization"."is_authorized" + AND "users_user"."is_active") + LIMIT 1 + ''', + }), + dict({ + 'origin': list([ + 'DeprecatedUpdateJobSeekerStep2View.setup[www/apply/views/submit_views.py]', + 'DeprecatedUpdateJobSeekerStep2View.setup[utils/session.py]', + 'DeprecatedUpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + ]), + }) +# --- +# name: TestUpdateJobSeeker.test_as_authorized_prescriber_with_proxied_job_seeker_deprecated[queries - step 3] + dict({ + 'num_queries': 8, + 'queries': list([ + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE "users_user"."id" = %s + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "prescribers_prescribermembership"."id", + "prescribers_prescribermembership"."user_id", + "prescribers_prescribermembership"."joined_at", + "prescribers_prescribermembership"."is_admin", + "prescribers_prescribermembership"."is_active", + "prescribers_prescribermembership"."created_at", + "prescribers_prescribermembership"."updated_at", + "prescribers_prescribermembership"."organization_id", + "prescribers_prescribermembership"."updated_by_id", + "prescribers_prescriberorganization"."id", + "prescribers_prescriberorganization"."address_line_1", + "prescribers_prescriberorganization"."address_line_2", + "prescribers_prescriberorganization"."post_code", + "prescribers_prescriberorganization"."city", + "prescribers_prescriberorganization"."department", + "prescribers_prescriberorganization"."coords", + "prescribers_prescriberorganization"."geocoding_score", + "prescribers_prescriberorganization"."geocoding_updated_at", + "prescribers_prescriberorganization"."ban_api_resolved_address", + "prescribers_prescriberorganization"."insee_city_id", + "prescribers_prescriberorganization"."name", + "prescribers_prescriberorganization"."created_at", + "prescribers_prescriberorganization"."updated_at", + "prescribers_prescriberorganization"."uid", + "prescribers_prescriberorganization"."active_members_email_reminder_last_sent_at", + "prescribers_prescriberorganization"."automatic_geocoding_update", + "prescribers_prescriberorganization"."siret", + "prescribers_prescriberorganization"."is_head_office", + "prescribers_prescriberorganization"."kind", + "prescribers_prescriberorganization"."is_brsa", + "prescribers_prescriberorganization"."phone", + "prescribers_prescriberorganization"."email", + "prescribers_prescriberorganization"."website", + "prescribers_prescriberorganization"."description", + "prescribers_prescriberorganization"."is_authorized", + "prescribers_prescriberorganization"."code_safir_pole_emploi", + "prescribers_prescriberorganization"."created_by_id", + "prescribers_prescriberorganization"."authorization_status", + "prescribers_prescriberorganization"."authorization_updated_at", + "prescribers_prescriberorganization"."authorization_updated_by_id" + FROM "prescribers_prescribermembership" + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active") + ORDER BY "prescribers_prescribermembership"."created_at" ASC + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'DeprecatedUpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login", + "users_jobseekerprofile"."user_id", + "users_jobseekerprofile"."birthdate", + "users_jobseekerprofile"."birth_place_id", + "users_jobseekerprofile"."birth_country_id", + "users_jobseekerprofile"."nir", + "users_jobseekerprofile"."lack_of_nir_reason", + "users_jobseekerprofile"."pole_emploi_id", + "users_jobseekerprofile"."lack_of_pole_emploi_id_reason", + "users_jobseekerprofile"."asp_uid", + "users_jobseekerprofile"."education_level", + "users_jobseekerprofile"."resourceless", + "users_jobseekerprofile"."rqth_employee", + "users_jobseekerprofile"."oeth_employee", + "users_jobseekerprofile"."pole_emploi_since", + "users_jobseekerprofile"."unemployed_since", + "users_jobseekerprofile"."has_rsa_allocation", + "users_jobseekerprofile"."rsa_allocation_since", + "users_jobseekerprofile"."ass_allocation_since", + "users_jobseekerprofile"."aah_allocation_since", + "users_jobseekerprofile"."are_allocation_since", + "users_jobseekerprofile"."activity_bonus_since", + "users_jobseekerprofile"."cape_freelance", + "users_jobseekerprofile"."cesa_freelance", + "users_jobseekerprofile"."actor_met_for_business_creation", + "users_jobseekerprofile"."mean_monthly_income_before_process", + "users_jobseekerprofile"."eiti_contributions", + "users_jobseekerprofile"."hexa_lane_number", + "users_jobseekerprofile"."hexa_std_extension", + "users_jobseekerprofile"."hexa_non_std_extension", + "users_jobseekerprofile"."hexa_lane_type", + "users_jobseekerprofile"."hexa_lane_name", + "users_jobseekerprofile"."hexa_additional_address", + "users_jobseekerprofile"."hexa_post_code", + "users_jobseekerprofile"."hexa_commune_id", + "users_jobseekerprofile"."pe_obfuscated_nir", + "users_jobseekerprofile"."pe_last_certification_attempt_at" + FROM "users_user" + LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") + WHERE ("users_user"."kind" = %s + AND "users_user"."public_id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'User.is_prescriber_with_authorized_org[users/models.py]', + 'User.can_edit_personal_information[users/models.py]', + 'User.can_view_personal_information[users/models.py]', + 'DeprecatedUpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT %s AS "a" + FROM "prescribers_prescribermembership" + INNER JOIN "users_user" ON ("prescribers_prescribermembership"."user_id" = "users_user"."id") + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active" + AND "prescribers_prescriberorganization"."is_authorized" + AND "users_user"."is_active") + LIMIT 1 + ''', + }), + dict({ + 'origin': list([ + 'DeprecatedUpdateJobSeekerStep3View.setup[www/apply/views/submit_views.py]', + 'DeprecatedUpdateJobSeekerStep3View.setup[utils/session.py]', + 'DeprecatedUpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + ]), + }) +# --- +# name: TestUpdateJobSeeker.test_as_company_with_proxied_job_seeker[queries - start] + dict({ + 'num_queries': 11, + 'queries': list([ + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE "users_user"."id" = %s + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "companies_companymembership"."id", + "companies_companymembership"."user_id", + "companies_companymembership"."joined_at", + "companies_companymembership"."is_admin", + "companies_companymembership"."is_active", + "companies_companymembership"."created_at", + "companies_companymembership"."updated_at", + "companies_companymembership"."company_id", + "companies_companymembership"."updated_by_id", + "companies_companymembership"."notifications" + FROM "companies_companymembership" + WHERE ("companies_companymembership"."user_id" = %s + AND "companies_companymembership"."is_active") + ORDER BY "companies_companymembership"."created_at" ASC + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."deactivated_at" >= %s + AND U0."id" = ("companies_company"."convention_id")) + LIMIT 1) AS "has_convention_in_grace_period", + "companies_siaeconvention"."id", + "companies_siaeconvention"."kind", + "companies_siaeconvention"."siret_signature", + "companies_siaeconvention"."is_active", + "companies_siaeconvention"."deactivated_at", + "companies_siaeconvention"."reactivated_by_id", + "companies_siaeconvention"."reactivated_at", + "companies_siaeconvention"."asp_id", + "companies_siaeconvention"."created_at", + "companies_siaeconvention"."updated_at" + FROM "companies_company" + INNER JOIN "companies_companymembership" ON ("companies_company"."id" = "companies_companymembership"."company_id") + LEFT OUTER JOIN "companies_siaeconvention" ON ("companies_company"."convention_id" = "companies_siaeconvention"."id") + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_companymembership"."user_id" = %s + AND "companies_company"."id" IN (%s) + AND (NOT ("companies_company"."kind" IN (%s, + %s, + %s, + %s, + %s)) + OR "companies_company"."source" = %s + OR EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."id" = ("companies_company"."convention_id") + AND U0."is_active") + LIMIT 1) + OR EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."deactivated_at" >= %s + AND U0."id" = ("companies_company"."convention_id")) + LIMIT 1))) + ORDER BY RANDOM() ASC + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStartView.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE ("users_user"."kind" = %s + AND "users_user"."public_id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStartView.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'Session.save[/django/db/models/base.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + UPDATE "django_session" + SET "session_data" = %s, + "expire_date" = %s + WHERE "django_session"."session_key" = %s + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + ]), + }) +# --- +# name: TestUpdateJobSeeker.test_as_company_with_proxied_job_seeker[queries - step 1] + dict({ + 'num_queries': 14, + 'queries': list([ + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE "users_user"."id" = %s + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "companies_companymembership"."id", + "companies_companymembership"."user_id", + "companies_companymembership"."joined_at", + "companies_companymembership"."is_admin", + "companies_companymembership"."is_active", + "companies_companymembership"."created_at", + "companies_companymembership"."updated_at", + "companies_companymembership"."company_id", + "companies_companymembership"."updated_by_id", + "companies_companymembership"."notifications" + FROM "companies_companymembership" + WHERE ("companies_companymembership"."user_id" = %s + AND "companies_companymembership"."is_active") + ORDER BY "companies_companymembership"."created_at" ASC + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."deactivated_at" >= %s + AND U0."id" = ("companies_company"."convention_id")) + LIMIT 1) AS "has_convention_in_grace_period", + "companies_siaeconvention"."id", + "companies_siaeconvention"."kind", + "companies_siaeconvention"."siret_signature", + "companies_siaeconvention"."is_active", + "companies_siaeconvention"."deactivated_at", + "companies_siaeconvention"."reactivated_by_id", + "companies_siaeconvention"."reactivated_at", + "companies_siaeconvention"."asp_id", + "companies_siaeconvention"."created_at", + "companies_siaeconvention"."updated_at" + FROM "companies_company" + INNER JOIN "companies_companymembership" ON ("companies_company"."id" = "companies_companymembership"."company_id") + LEFT OUTER JOIN "companies_siaeconvention" ON ("companies_company"."convention_id" = "companies_siaeconvention"."id") + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_companymembership"."user_id" = %s + AND "companies_company"."id" IN (%s) + AND (NOT ("companies_company"."kind" IN (%s, + %s, + %s, + %s, + %s)) + OR "companies_company"."source" = %s + OR EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."id" = ("companies_company"."convention_id") + AND U0."is_active") + LIMIT 1) + OR EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."deactivated_at" >= %s + AND U0."id" = ("companies_company"."convention_id")) + LIMIT 1))) + ORDER BY RANDOM() ASC + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login", + "users_jobseekerprofile"."user_id", + "users_jobseekerprofile"."birthdate", + "users_jobseekerprofile"."birth_place_id", + "users_jobseekerprofile"."birth_country_id", + "users_jobseekerprofile"."nir", + "users_jobseekerprofile"."lack_of_nir_reason", + "users_jobseekerprofile"."pole_emploi_id", + "users_jobseekerprofile"."lack_of_pole_emploi_id_reason", + "users_jobseekerprofile"."asp_uid", + "users_jobseekerprofile"."education_level", + "users_jobseekerprofile"."resourceless", + "users_jobseekerprofile"."rqth_employee", + "users_jobseekerprofile"."oeth_employee", + "users_jobseekerprofile"."pole_emploi_since", + "users_jobseekerprofile"."unemployed_since", + "users_jobseekerprofile"."has_rsa_allocation", + "users_jobseekerprofile"."rsa_allocation_since", + "users_jobseekerprofile"."ass_allocation_since", + "users_jobseekerprofile"."aah_allocation_since", + "users_jobseekerprofile"."are_allocation_since", + "users_jobseekerprofile"."activity_bonus_since", + "users_jobseekerprofile"."cape_freelance", + "users_jobseekerprofile"."cesa_freelance", + "users_jobseekerprofile"."actor_met_for_business_creation", + "users_jobseekerprofile"."mean_monthly_income_before_process", + "users_jobseekerprofile"."eiti_contributions", + "users_jobseekerprofile"."hexa_lane_number", + "users_jobseekerprofile"."hexa_std_extension", + "users_jobseekerprofile"."hexa_non_std_extension", + "users_jobseekerprofile"."hexa_lane_type", + "users_jobseekerprofile"."hexa_lane_name", + "users_jobseekerprofile"."hexa_additional_address", + "users_jobseekerprofile"."hexa_post_code", + "users_jobseekerprofile"."hexa_commune_id", + "users_jobseekerprofile"."pe_obfuscated_nir", + "users_jobseekerprofile"."pe_last_certification_attempt_at" + FROM "users_user" + LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") + WHERE ("users_user"."kind" = %s + AND "users_user"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'Company.has_admin[common_apps/organizations/models.py]', + 'Company.convention_can_be_accessed_by[companies/models.py]', + 'nav[utils/templatetags/nav.py]', + 'InclusionNode[layout/_header_authenticated.html]', + 'IncludeNode[layout/base.html]', + 'IfNode[layout/base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', + ]), + 'sql': ''' + SELECT %s AS "a" + FROM "users_user" + INNER JOIN "companies_companymembership" ON ("users_user"."id" = "companies_companymembership"."user_id") + WHERE ("companies_companymembership"."id" IN + (SELECT U0."id" + FROM "companies_companymembership" U0 + INNER JOIN "users_user" U2 ON (U0."user_id" = U2."id") + WHERE (U0."company_id" = %s + AND U2."is_active" + AND U0."is_active" + AND U0."is_admin" + AND U2."is_active")) + AND "users_user"."id" = %s) + LIMIT 1 + ''', + }), + dict({ + 'origin': list([ + 'CustomFieldRenderer.render[utils/custom_renderer.py]', + 'SimpleNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', + 'IfNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', + 'BlockNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', + 'BlockNode[layout/base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', + ]), + 'sql': ''' + SELECT "asp_country"."id", + "asp_country"."code", + "asp_country"."name", + "asp_country"."group", + "asp_country"."department" + FROM "asp_country" + ORDER BY "asp_country"."name" ASC + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'Session.save[/django/db/models/base.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + UPDATE "django_session" + SET "session_data" = %s, + "expire_date" = %s + WHERE "django_session"."session_key" = %s + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + ]), + }) +# --- +# name: TestUpdateJobSeeker.test_as_company_with_proxied_job_seeker[queries - step 2] + dict({ + 'num_queries': 10, + 'queries': list([ + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE "users_user"."id" = %s + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "companies_companymembership"."id", + "companies_companymembership"."user_id", + "companies_companymembership"."joined_at", + "companies_companymembership"."is_admin", + "companies_companymembership"."is_active", + "companies_companymembership"."created_at", + "companies_companymembership"."updated_at", + "companies_companymembership"."company_id", + "companies_companymembership"."updated_by_id", + "companies_companymembership"."notifications" + FROM "companies_companymembership" + WHERE ("companies_companymembership"."user_id" = %s + AND "companies_companymembership"."is_active") + ORDER BY "companies_companymembership"."created_at" ASC + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."deactivated_at" >= %s + AND U0."id" = ("companies_company"."convention_id")) + LIMIT 1) AS "has_convention_in_grace_period", + "companies_siaeconvention"."id", + "companies_siaeconvention"."kind", + "companies_siaeconvention"."siret_signature", + "companies_siaeconvention"."is_active", + "companies_siaeconvention"."deactivated_at", + "companies_siaeconvention"."reactivated_by_id", + "companies_siaeconvention"."reactivated_at", + "companies_siaeconvention"."asp_id", + "companies_siaeconvention"."created_at", + "companies_siaeconvention"."updated_at" + FROM "companies_company" + INNER JOIN "companies_companymembership" ON ("companies_company"."id" = "companies_companymembership"."company_id") + LEFT OUTER JOIN "companies_siaeconvention" ON ("companies_company"."convention_id" = "companies_siaeconvention"."id") + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_companymembership"."user_id" = %s + AND "companies_company"."id" IN (%s) + AND (NOT ("companies_company"."kind" IN (%s, + %s, + %s, + %s, + %s)) + OR "companies_company"."source" = %s + OR EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."id" = ("companies_company"."convention_id") + AND U0."is_active") + LIMIT 1) + OR EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."deactivated_at" >= %s + AND U0."id" = ("companies_company"."convention_id")) + LIMIT 1))) + ORDER BY RANDOM() ASC + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE ("users_user"."kind" = %s + AND "users_user"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'Company.has_admin[common_apps/organizations/models.py]', + 'Company.convention_can_be_accessed_by[companies/models.py]', + 'nav[utils/templatetags/nav.py]', + 'InclusionNode[layout/_header_authenticated.html]', + 'IncludeNode[layout/base.html]', + 'IfNode[layout/base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_2.html]', + ]), + 'sql': ''' + SELECT %s AS "a" + FROM "users_user" + INNER JOIN "companies_companymembership" ON ("users_user"."id" = "companies_companymembership"."user_id") + WHERE ("companies_companymembership"."id" IN + (SELECT U0."id" + FROM "companies_companymembership" U0 + INNER JOIN "users_user" U2 ON (U0."user_id" = U2."id") + WHERE (U0."company_id" = %s + AND U2."is_active" + AND U0."is_active" + AND U0."is_admin" + AND U2."is_active")) + AND "users_user"."id" = %s) + LIMIT 1 + ''', + }), + ]), + }) +# --- +# name: TestUpdateJobSeeker.test_as_company_with_proxied_job_seeker[queries - step 3] + dict({ + 'num_queries': 10, + 'queries': list([ + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE "users_user"."id" = %s + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "companies_companymembership"."id", + "companies_companymembership"."user_id", + "companies_companymembership"."joined_at", + "companies_companymembership"."is_admin", + "companies_companymembership"."is_active", + "companies_companymembership"."created_at", + "companies_companymembership"."updated_at", + "companies_companymembership"."company_id", + "companies_companymembership"."updated_by_id", + "companies_companymembership"."notifications" + FROM "companies_companymembership" + WHERE ("companies_companymembership"."user_id" = %s + AND "companies_companymembership"."is_active") + ORDER BY "companies_companymembership"."created_at" ASC + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."deactivated_at" >= %s + AND U0."id" = ("companies_company"."convention_id")) + LIMIT 1) AS "has_convention_in_grace_period", + "companies_siaeconvention"."id", + "companies_siaeconvention"."kind", + "companies_siaeconvention"."siret_signature", + "companies_siaeconvention"."is_active", + "companies_siaeconvention"."deactivated_at", + "companies_siaeconvention"."reactivated_by_id", + "companies_siaeconvention"."reactivated_at", + "companies_siaeconvention"."asp_id", + "companies_siaeconvention"."created_at", + "companies_siaeconvention"."updated_at" + FROM "companies_company" + INNER JOIN "companies_companymembership" ON ("companies_company"."id" = "companies_companymembership"."company_id") + LEFT OUTER JOIN "companies_siaeconvention" ON ("companies_company"."convention_id" = "companies_siaeconvention"."id") + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_companymembership"."user_id" = %s + AND "companies_company"."id" IN (%s) + AND (NOT ("companies_company"."kind" IN (%s, + %s, + %s, + %s, + %s)) + OR "companies_company"."source" = %s + OR EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."id" = ("companies_company"."convention_id") + AND U0."is_active") + LIMIT 1) + OR EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."deactivated_at" >= %s + AND U0."id" = ("companies_company"."convention_id")) + LIMIT 1))) + ORDER BY RANDOM() ASC + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login", + "users_jobseekerprofile"."user_id", + "users_jobseekerprofile"."birthdate", + "users_jobseekerprofile"."birth_place_id", + "users_jobseekerprofile"."birth_country_id", + "users_jobseekerprofile"."nir", + "users_jobseekerprofile"."lack_of_nir_reason", + "users_jobseekerprofile"."pole_emploi_id", + "users_jobseekerprofile"."lack_of_pole_emploi_id_reason", + "users_jobseekerprofile"."asp_uid", + "users_jobseekerprofile"."education_level", + "users_jobseekerprofile"."resourceless", + "users_jobseekerprofile"."rqth_employee", + "users_jobseekerprofile"."oeth_employee", + "users_jobseekerprofile"."pole_emploi_since", + "users_jobseekerprofile"."unemployed_since", + "users_jobseekerprofile"."has_rsa_allocation", + "users_jobseekerprofile"."rsa_allocation_since", + "users_jobseekerprofile"."ass_allocation_since", + "users_jobseekerprofile"."aah_allocation_since", + "users_jobseekerprofile"."are_allocation_since", + "users_jobseekerprofile"."activity_bonus_since", + "users_jobseekerprofile"."cape_freelance", + "users_jobseekerprofile"."cesa_freelance", + "users_jobseekerprofile"."actor_met_for_business_creation", + "users_jobseekerprofile"."mean_monthly_income_before_process", + "users_jobseekerprofile"."eiti_contributions", + "users_jobseekerprofile"."hexa_lane_number", + "users_jobseekerprofile"."hexa_std_extension", + "users_jobseekerprofile"."hexa_non_std_extension", + "users_jobseekerprofile"."hexa_lane_type", + "users_jobseekerprofile"."hexa_lane_name", + "users_jobseekerprofile"."hexa_additional_address", + "users_jobseekerprofile"."hexa_post_code", + "users_jobseekerprofile"."hexa_commune_id", + "users_jobseekerprofile"."pe_obfuscated_nir", + "users_jobseekerprofile"."pe_last_certification_attempt_at" + FROM "users_user" + LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") + WHERE ("users_user"."kind" = %s + AND "users_user"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'Company.has_admin[common_apps/organizations/models.py]', + 'Company.convention_can_be_accessed_by[companies/models.py]', + 'nav[utils/templatetags/nav.py]', + 'InclusionNode[layout/_header_authenticated.html]', + 'IncludeNode[layout/base.html]', + 'IfNode[layout/base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_3.html]', + ]), + 'sql': ''' + SELECT %s AS "a" + FROM "users_user" + INNER JOIN "companies_companymembership" ON ("users_user"."id" = "companies_companymembership"."user_id") + WHERE ("companies_companymembership"."id" IN + (SELECT U0."id" + FROM "companies_companymembership" U0 + INNER JOIN "users_user" U2 ON (U0."user_id" = U2."id") + WHERE (U0."company_id" = %s + AND U2."is_active" + AND U0."is_active" + AND U0."is_admin" + AND U2."is_active")) + AND "users_user"."id" = %s) + LIMIT 1 + ''', + }), + ]), + }) +# --- +# name: TestUpdateJobSeeker.test_as_company_with_proxied_job_seeker_deprecated[queries - step 2] + dict({ + 'num_queries': 9, + 'queries': list([ + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE "users_user"."id" = %s + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "companies_companymembership"."id", + "companies_companymembership"."user_id", + "companies_companymembership"."joined_at", + "companies_companymembership"."is_admin", + "companies_companymembership"."is_active", + "companies_companymembership"."created_at", + "companies_companymembership"."updated_at", + "companies_companymembership"."company_id", + "companies_companymembership"."updated_by_id", + "companies_companymembership"."notifications" + FROM "companies_companymembership" + WHERE ("companies_companymembership"."user_id" = %s + AND "companies_companymembership"."is_active") + ORDER BY "companies_companymembership"."created_at" ASC + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."deactivated_at" >= %s + AND U0."id" = ("companies_company"."convention_id")) + LIMIT 1) AS "has_convention_in_grace_period", + "companies_siaeconvention"."id", + "companies_siaeconvention"."kind", + "companies_siaeconvention"."siret_signature", + "companies_siaeconvention"."is_active", + "companies_siaeconvention"."deactivated_at", + "companies_siaeconvention"."reactivated_by_id", + "companies_siaeconvention"."reactivated_at", + "companies_siaeconvention"."asp_id", + "companies_siaeconvention"."created_at", + "companies_siaeconvention"."updated_at" + FROM "companies_company" + INNER JOIN "companies_companymembership" ON ("companies_company"."id" = "companies_companymembership"."company_id") + LEFT OUTER JOIN "companies_siaeconvention" ON ("companies_company"."convention_id" = "companies_siaeconvention"."id") + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_companymembership"."user_id" = %s + AND "companies_company"."id" IN (%s) + AND (NOT ("companies_company"."kind" IN (%s, + %s, + %s, + %s, + %s)) + OR "companies_company"."source" = %s + OR EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."id" = ("companies_company"."convention_id") + AND U0."is_active") + LIMIT 1) + OR EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."deactivated_at" >= %s + AND U0."id" = ("companies_company"."convention_id")) + LIMIT 1))) + ORDER BY RANDOM() ASC + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'DeprecatedUpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE ("users_user"."kind" = %s + AND "users_user"."public_id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'DeprecatedUpdateJobSeekerStep2View.setup[www/apply/views/submit_views.py]', + 'DeprecatedUpdateJobSeekerStep2View.setup[utils/session.py]', + 'DeprecatedUpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'Company.has_admin[common_apps/organizations/models.py]', + 'Company.convention_can_be_accessed_by[companies/models.py]', + 'nav[utils/templatetags/nav.py]', + 'InclusionNode[layout/_header_authenticated.html]', + 'IncludeNode[layout/base.html]', + 'IfNode[layout/base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_2.html]', + ]), + 'sql': ''' + SELECT %s AS "a" + FROM "users_user" + INNER JOIN "companies_companymembership" ON ("users_user"."id" = "companies_companymembership"."user_id") + WHERE ("companies_companymembership"."id" IN + (SELECT U0."id" + FROM "companies_companymembership" U0 + INNER JOIN "users_user" U2 ON (U0."user_id" = U2."id") + WHERE (U0."company_id" = %s + AND U2."is_active" + AND U0."is_active" + AND U0."is_admin" + AND U2."is_active")) + AND "users_user"."id" = %s) + LIMIT 1 + ''', + }), + ]), + }) +# --- +# name: TestUpdateJobSeeker.test_as_company_with_proxied_job_seeker_deprecated[queries - step 3] + dict({ + 'num_queries': 9, + 'queries': list([ + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE "users_user"."id" = %s + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "companies_companymembership"."id", + "companies_companymembership"."user_id", + "companies_companymembership"."joined_at", + "companies_companymembership"."is_admin", + "companies_companymembership"."is_active", + "companies_companymembership"."created_at", + "companies_companymembership"."updated_at", + "companies_companymembership"."company_id", + "companies_companymembership"."updated_by_id", + "companies_companymembership"."notifications" + FROM "companies_companymembership" + WHERE ("companies_companymembership"."user_id" = %s + AND "companies_companymembership"."is_active") + ORDER BY "companies_companymembership"."created_at" ASC + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."deactivated_at" >= %s + AND U0."id" = ("companies_company"."convention_id")) + LIMIT 1) AS "has_convention_in_grace_period", + "companies_siaeconvention"."id", + "companies_siaeconvention"."kind", + "companies_siaeconvention"."siret_signature", + "companies_siaeconvention"."is_active", + "companies_siaeconvention"."deactivated_at", + "companies_siaeconvention"."reactivated_by_id", + "companies_siaeconvention"."reactivated_at", + "companies_siaeconvention"."asp_id", + "companies_siaeconvention"."created_at", + "companies_siaeconvention"."updated_at" + FROM "companies_company" + INNER JOIN "companies_companymembership" ON ("companies_company"."id" = "companies_companymembership"."company_id") + LEFT OUTER JOIN "companies_siaeconvention" ON ("companies_company"."convention_id" = "companies_siaeconvention"."id") + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_companymembership"."user_id" = %s + AND "companies_company"."id" IN (%s) + AND (NOT ("companies_company"."kind" IN (%s, + %s, + %s, + %s, + %s)) + OR "companies_company"."source" = %s + OR EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."id" = ("companies_company"."convention_id") + AND U0."is_active") + LIMIT 1) + OR EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."deactivated_at" >= %s + AND U0."id" = ("companies_company"."convention_id")) + LIMIT 1))) + ORDER BY RANDOM() ASC + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'DeprecatedUpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login", + "users_jobseekerprofile"."user_id", + "users_jobseekerprofile"."birthdate", + "users_jobseekerprofile"."birth_place_id", + "users_jobseekerprofile"."birth_country_id", + "users_jobseekerprofile"."nir", + "users_jobseekerprofile"."lack_of_nir_reason", + "users_jobseekerprofile"."pole_emploi_id", + "users_jobseekerprofile"."lack_of_pole_emploi_id_reason", + "users_jobseekerprofile"."asp_uid", + "users_jobseekerprofile"."education_level", + "users_jobseekerprofile"."resourceless", + "users_jobseekerprofile"."rqth_employee", + "users_jobseekerprofile"."oeth_employee", + "users_jobseekerprofile"."pole_emploi_since", + "users_jobseekerprofile"."unemployed_since", + "users_jobseekerprofile"."has_rsa_allocation", + "users_jobseekerprofile"."rsa_allocation_since", + "users_jobseekerprofile"."ass_allocation_since", + "users_jobseekerprofile"."aah_allocation_since", + "users_jobseekerprofile"."are_allocation_since", + "users_jobseekerprofile"."activity_bonus_since", + "users_jobseekerprofile"."cape_freelance", + "users_jobseekerprofile"."cesa_freelance", + "users_jobseekerprofile"."actor_met_for_business_creation", + "users_jobseekerprofile"."mean_monthly_income_before_process", + "users_jobseekerprofile"."eiti_contributions", + "users_jobseekerprofile"."hexa_lane_number", + "users_jobseekerprofile"."hexa_std_extension", + "users_jobseekerprofile"."hexa_non_std_extension", + "users_jobseekerprofile"."hexa_lane_type", + "users_jobseekerprofile"."hexa_lane_name", + "users_jobseekerprofile"."hexa_additional_address", + "users_jobseekerprofile"."hexa_post_code", + "users_jobseekerprofile"."hexa_commune_id", + "users_jobseekerprofile"."pe_obfuscated_nir", + "users_jobseekerprofile"."pe_last_certification_attempt_at" + FROM "users_user" + LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") + WHERE ("users_user"."kind" = %s + AND "users_user"."public_id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'DeprecatedUpdateJobSeekerStep3View.setup[www/apply/views/submit_views.py]', + 'DeprecatedUpdateJobSeekerStep3View.setup[utils/session.py]', + 'DeprecatedUpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'Company.has_admin[common_apps/organizations/models.py]', + 'Company.convention_can_be_accessed_by[companies/models.py]', + 'nav[utils/templatetags/nav.py]', + 'InclusionNode[layout/_header_authenticated.html]', + 'IncludeNode[layout/base.html]', + 'IfNode[layout/base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_3.html]', + ]), + 'sql': ''' + SELECT %s AS "a" + FROM "users_user" + INNER JOIN "companies_companymembership" ON ("users_user"."id" = "companies_companymembership"."user_id") + WHERE ("companies_companymembership"."id" IN + (SELECT U0."id" + FROM "companies_companymembership" U0 + INNER JOIN "users_user" U2 ON (U0."user_id" = U2."id") + WHERE (U0."company_id" = %s + AND U2."is_active" + AND U0."is_active" + AND U0."is_admin" + AND U2."is_active")) + AND "users_user"."id" = %s) + LIMIT 1 + ''', + }), + ]), + }) +# --- +# name: TestUpdateJobSeeker.test_as_unauthorized_prescriber_that_created_proxied_job_seeker[queries - start] + dict({ + 'num_queries': 11, + 'queries': list([ + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE "users_user"."id" = %s + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "prescribers_prescribermembership"."id", + "prescribers_prescribermembership"."user_id", + "prescribers_prescribermembership"."joined_at", + "prescribers_prescribermembership"."is_admin", + "prescribers_prescribermembership"."is_active", + "prescribers_prescribermembership"."created_at", + "prescribers_prescribermembership"."updated_at", + "prescribers_prescribermembership"."organization_id", + "prescribers_prescribermembership"."updated_by_id", + "prescribers_prescriberorganization"."id", + "prescribers_prescriberorganization"."address_line_1", + "prescribers_prescriberorganization"."address_line_2", + "prescribers_prescriberorganization"."post_code", + "prescribers_prescriberorganization"."city", + "prescribers_prescriberorganization"."department", + "prescribers_prescriberorganization"."coords", + "prescribers_prescriberorganization"."geocoding_score", + "prescribers_prescriberorganization"."geocoding_updated_at", + "prescribers_prescriberorganization"."ban_api_resolved_address", + "prescribers_prescriberorganization"."insee_city_id", + "prescribers_prescriberorganization"."name", + "prescribers_prescriberorganization"."created_at", + "prescribers_prescriberorganization"."updated_at", + "prescribers_prescriberorganization"."uid", + "prescribers_prescriberorganization"."active_members_email_reminder_last_sent_at", + "prescribers_prescriberorganization"."automatic_geocoding_update", + "prescribers_prescriberorganization"."siret", + "prescribers_prescriberorganization"."is_head_office", + "prescribers_prescriberorganization"."kind", + "prescribers_prescriberorganization"."is_brsa", + "prescribers_prescriberorganization"."phone", + "prescribers_prescriberorganization"."email", + "prescribers_prescriberorganization"."website", + "prescribers_prescriberorganization"."description", + "prescribers_prescriberorganization"."is_authorized", + "prescribers_prescriberorganization"."code_safir_pole_emploi", + "prescribers_prescriberorganization"."created_by_id", + "prescribers_prescriberorganization"."authorization_status", + "prescribers_prescriberorganization"."authorization_updated_at", + "prescribers_prescriberorganization"."authorization_updated_by_id" + FROM "prescribers_prescribermembership" + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active") + ORDER BY "prescribers_prescribermembership"."created_at" ASC + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStartView.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE ("users_user"."kind" = %s + AND "users_user"."public_id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStartView.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'User.is_prescriber_with_authorized_org[users/models.py]', + 'User.can_edit_personal_information[users/models.py]', + 'User.can_view_personal_information[users/models.py]', + 'UpdateJobSeekerStartView.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT %s AS "a" + FROM "prescribers_prescribermembership" + INNER JOIN "users_user" ON ("prescribers_prescribermembership"."user_id" = "users_user"."id") + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active" + AND "prescribers_prescriberorganization"."is_authorized" + AND "users_user"."is_active") + LIMIT 1 + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'Session.save[/django/db/models/base.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + UPDATE "django_session" + SET "session_data" = %s, + "expire_date" = %s + WHERE "django_session"."session_key" = %s + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + ]), + }) +# --- +# name: TestUpdateJobSeeker.test_as_unauthorized_prescriber_that_created_proxied_job_seeker[queries - step 1] + dict({ + 'num_queries': 13, + 'queries': list([ + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE "users_user"."id" = %s + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "prescribers_prescribermembership"."id", + "prescribers_prescribermembership"."user_id", + "prescribers_prescribermembership"."joined_at", + "prescribers_prescribermembership"."is_admin", + "prescribers_prescribermembership"."is_active", + "prescribers_prescribermembership"."created_at", + "prescribers_prescribermembership"."updated_at", + "prescribers_prescribermembership"."organization_id", + "prescribers_prescribermembership"."updated_by_id", + "prescribers_prescriberorganization"."id", + "prescribers_prescriberorganization"."address_line_1", + "prescribers_prescriberorganization"."address_line_2", + "prescribers_prescriberorganization"."post_code", + "prescribers_prescriberorganization"."city", + "prescribers_prescriberorganization"."department", + "prescribers_prescriberorganization"."coords", + "prescribers_prescriberorganization"."geocoding_score", + "prescribers_prescriberorganization"."geocoding_updated_at", + "prescribers_prescriberorganization"."ban_api_resolved_address", + "prescribers_prescriberorganization"."insee_city_id", + "prescribers_prescriberorganization"."name", + "prescribers_prescriberorganization"."created_at", + "prescribers_prescriberorganization"."updated_at", + "prescribers_prescriberorganization"."uid", + "prescribers_prescriberorganization"."active_members_email_reminder_last_sent_at", + "prescribers_prescriberorganization"."automatic_geocoding_update", + "prescribers_prescriberorganization"."siret", + "prescribers_prescriberorganization"."is_head_office", + "prescribers_prescriberorganization"."kind", + "prescribers_prescriberorganization"."is_brsa", + "prescribers_prescriberorganization"."phone", + "prescribers_prescriberorganization"."email", + "prescribers_prescriberorganization"."website", + "prescribers_prescriberorganization"."description", + "prescribers_prescriberorganization"."is_authorized", + "prescribers_prescriberorganization"."code_safir_pole_emploi", + "prescribers_prescriberorganization"."created_by_id", + "prescribers_prescriberorganization"."authorization_status", + "prescribers_prescriberorganization"."authorization_updated_at", + "prescribers_prescriberorganization"."authorization_updated_by_id" + FROM "prescribers_prescribermembership" + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active") + ORDER BY "prescribers_prescribermembership"."created_at" ASC + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login", + "users_jobseekerprofile"."user_id", + "users_jobseekerprofile"."birthdate", + "users_jobseekerprofile"."birth_place_id", + "users_jobseekerprofile"."birth_country_id", + "users_jobseekerprofile"."nir", + "users_jobseekerprofile"."lack_of_nir_reason", + "users_jobseekerprofile"."pole_emploi_id", + "users_jobseekerprofile"."lack_of_pole_emploi_id_reason", + "users_jobseekerprofile"."asp_uid", + "users_jobseekerprofile"."education_level", + "users_jobseekerprofile"."resourceless", + "users_jobseekerprofile"."rqth_employee", + "users_jobseekerprofile"."oeth_employee", + "users_jobseekerprofile"."pole_emploi_since", + "users_jobseekerprofile"."unemployed_since", + "users_jobseekerprofile"."has_rsa_allocation", + "users_jobseekerprofile"."rsa_allocation_since", + "users_jobseekerprofile"."ass_allocation_since", + "users_jobseekerprofile"."aah_allocation_since", + "users_jobseekerprofile"."are_allocation_since", + "users_jobseekerprofile"."activity_bonus_since", + "users_jobseekerprofile"."cape_freelance", + "users_jobseekerprofile"."cesa_freelance", + "users_jobseekerprofile"."actor_met_for_business_creation", + "users_jobseekerprofile"."mean_monthly_income_before_process", + "users_jobseekerprofile"."eiti_contributions", + "users_jobseekerprofile"."hexa_lane_number", + "users_jobseekerprofile"."hexa_std_extension", + "users_jobseekerprofile"."hexa_non_std_extension", + "users_jobseekerprofile"."hexa_lane_type", + "users_jobseekerprofile"."hexa_lane_name", + "users_jobseekerprofile"."hexa_additional_address", + "users_jobseekerprofile"."hexa_post_code", + "users_jobseekerprofile"."hexa_commune_id", + "users_jobseekerprofile"."pe_obfuscated_nir", + "users_jobseekerprofile"."pe_last_certification_attempt_at" + FROM "users_user" + LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") + WHERE ("users_user"."kind" = %s + AND "users_user"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'User.is_prescriber_with_authorized_org[users/models.py]', + 'User.can_edit_personal_information[users/models.py]', + 'User.can_view_personal_information[users/models.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT %s AS "a" + FROM "prescribers_prescribermembership" + INNER JOIN "users_user" ON ("prescribers_prescribermembership"."user_id" = "users_user"."id") + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active" + AND "prescribers_prescriberorganization"."is_authorized" + AND "users_user"."is_active") + LIMIT 1 + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'CustomFieldRenderer.render[utils/custom_renderer.py]', + 'SimpleNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', + 'IfNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', + 'BlockNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', + 'BlockNode[layout/base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', + ]), + 'sql': ''' + SELECT "asp_country"."id", + "asp_country"."code", + "asp_country"."name", + "asp_country"."group", + "asp_country"."department" + FROM "asp_country" + ORDER BY "asp_country"."name" ASC + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'Session.save[/django/db/models/base.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + UPDATE "django_session" + SET "session_data" = %s, + "expire_date" = %s + WHERE "django_session"."session_key" = %s + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + ]), + }) +# --- +# name: TestUpdateJobSeeker.test_as_unauthorized_prescriber_that_created_proxied_job_seeker[queries - step 2] + dict({ + 'num_queries': 9, + 'queries': list([ + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE "users_user"."id" = %s + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "prescribers_prescribermembership"."id", + "prescribers_prescribermembership"."user_id", + "prescribers_prescribermembership"."joined_at", + "prescribers_prescribermembership"."is_admin", + "prescribers_prescribermembership"."is_active", + "prescribers_prescribermembership"."created_at", + "prescribers_prescribermembership"."updated_at", + "prescribers_prescribermembership"."organization_id", + "prescribers_prescribermembership"."updated_by_id", + "prescribers_prescriberorganization"."id", + "prescribers_prescriberorganization"."address_line_1", + "prescribers_prescriberorganization"."address_line_2", + "prescribers_prescriberorganization"."post_code", + "prescribers_prescriberorganization"."city", + "prescribers_prescriberorganization"."department", + "prescribers_prescriberorganization"."coords", + "prescribers_prescriberorganization"."geocoding_score", + "prescribers_prescriberorganization"."geocoding_updated_at", + "prescribers_prescriberorganization"."ban_api_resolved_address", + "prescribers_prescriberorganization"."insee_city_id", + "prescribers_prescriberorganization"."name", + "prescribers_prescriberorganization"."created_at", + "prescribers_prescriberorganization"."updated_at", + "prescribers_prescriberorganization"."uid", + "prescribers_prescriberorganization"."active_members_email_reminder_last_sent_at", + "prescribers_prescriberorganization"."automatic_geocoding_update", + "prescribers_prescriberorganization"."siret", + "prescribers_prescriberorganization"."is_head_office", + "prescribers_prescriberorganization"."kind", + "prescribers_prescriberorganization"."is_brsa", + "prescribers_prescriberorganization"."phone", + "prescribers_prescriberorganization"."email", + "prescribers_prescriberorganization"."website", + "prescribers_prescriberorganization"."description", + "prescribers_prescriberorganization"."is_authorized", + "prescribers_prescriberorganization"."code_safir_pole_emploi", + "prescribers_prescriberorganization"."created_by_id", + "prescribers_prescriberorganization"."authorization_status", + "prescribers_prescriberorganization"."authorization_updated_at", + "prescribers_prescriberorganization"."authorization_updated_by_id" + FROM "prescribers_prescribermembership" + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active") + ORDER BY "prescribers_prescribermembership"."created_at" ASC + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE ("users_user"."kind" = %s + AND "users_user"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'User.is_prescriber_with_authorized_org[users/models.py]', + 'User.can_edit_personal_information[users/models.py]', + 'User.can_view_personal_information[users/models.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT %s AS "a" + FROM "prescribers_prescribermembership" + INNER JOIN "users_user" ON ("prescribers_prescribermembership"."user_id" = "users_user"."id") + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active" + AND "prescribers_prescriberorganization"."is_authorized" + AND "users_user"."is_active") + LIMIT 1 + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + ]), + }) +# --- +# name: TestUpdateJobSeeker.test_as_unauthorized_prescriber_that_created_proxied_job_seeker[queries - step 3] + dict({ + 'num_queries': 9, + 'queries': list([ + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE "users_user"."id" = %s + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "prescribers_prescribermembership"."id", + "prescribers_prescribermembership"."user_id", + "prescribers_prescribermembership"."joined_at", + "prescribers_prescribermembership"."is_admin", + "prescribers_prescribermembership"."is_active", + "prescribers_prescribermembership"."created_at", + "prescribers_prescribermembership"."updated_at", + "prescribers_prescribermembership"."organization_id", + "prescribers_prescribermembership"."updated_by_id", + "prescribers_prescriberorganization"."id", + "prescribers_prescriberorganization"."address_line_1", + "prescribers_prescriberorganization"."address_line_2", + "prescribers_prescriberorganization"."post_code", + "prescribers_prescriberorganization"."city", + "prescribers_prescriberorganization"."department", + "prescribers_prescriberorganization"."coords", + "prescribers_prescriberorganization"."geocoding_score", + "prescribers_prescriberorganization"."geocoding_updated_at", + "prescribers_prescriberorganization"."ban_api_resolved_address", + "prescribers_prescriberorganization"."insee_city_id", + "prescribers_prescriberorganization"."name", + "prescribers_prescriberorganization"."created_at", + "prescribers_prescriberorganization"."updated_at", + "prescribers_prescriberorganization"."uid", + "prescribers_prescriberorganization"."active_members_email_reminder_last_sent_at", + "prescribers_prescriberorganization"."automatic_geocoding_update", + "prescribers_prescriberorganization"."siret", + "prescribers_prescriberorganization"."is_head_office", + "prescribers_prescriberorganization"."kind", + "prescribers_prescriberorganization"."is_brsa", + "prescribers_prescriberorganization"."phone", + "prescribers_prescriberorganization"."email", + "prescribers_prescriberorganization"."website", + "prescribers_prescriberorganization"."description", + "prescribers_prescriberorganization"."is_authorized", + "prescribers_prescriberorganization"."code_safir_pole_emploi", + "prescribers_prescriberorganization"."created_by_id", + "prescribers_prescriberorganization"."authorization_status", + "prescribers_prescriberorganization"."authorization_updated_at", + "prescribers_prescriberorganization"."authorization_updated_by_id" + FROM "prescribers_prescribermembership" + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active") + ORDER BY "prescribers_prescribermembership"."created_at" ASC + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login", + "users_jobseekerprofile"."user_id", + "users_jobseekerprofile"."birthdate", + "users_jobseekerprofile"."birth_place_id", + "users_jobseekerprofile"."birth_country_id", + "users_jobseekerprofile"."nir", + "users_jobseekerprofile"."lack_of_nir_reason", + "users_jobseekerprofile"."pole_emploi_id", + "users_jobseekerprofile"."lack_of_pole_emploi_id_reason", + "users_jobseekerprofile"."asp_uid", + "users_jobseekerprofile"."education_level", + "users_jobseekerprofile"."resourceless", + "users_jobseekerprofile"."rqth_employee", + "users_jobseekerprofile"."oeth_employee", + "users_jobseekerprofile"."pole_emploi_since", + "users_jobseekerprofile"."unemployed_since", + "users_jobseekerprofile"."has_rsa_allocation", + "users_jobseekerprofile"."rsa_allocation_since", + "users_jobseekerprofile"."ass_allocation_since", + "users_jobseekerprofile"."aah_allocation_since", + "users_jobseekerprofile"."are_allocation_since", + "users_jobseekerprofile"."activity_bonus_since", + "users_jobseekerprofile"."cape_freelance", + "users_jobseekerprofile"."cesa_freelance", + "users_jobseekerprofile"."actor_met_for_business_creation", + "users_jobseekerprofile"."mean_monthly_income_before_process", + "users_jobseekerprofile"."eiti_contributions", + "users_jobseekerprofile"."hexa_lane_number", + "users_jobseekerprofile"."hexa_std_extension", + "users_jobseekerprofile"."hexa_non_std_extension", + "users_jobseekerprofile"."hexa_lane_type", + "users_jobseekerprofile"."hexa_lane_name", + "users_jobseekerprofile"."hexa_additional_address", + "users_jobseekerprofile"."hexa_post_code", + "users_jobseekerprofile"."hexa_commune_id", + "users_jobseekerprofile"."pe_obfuscated_nir", + "users_jobseekerprofile"."pe_last_certification_attempt_at" + FROM "users_user" + LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") + WHERE ("users_user"."kind" = %s + AND "users_user"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'User.is_prescriber_with_authorized_org[users/models.py]', + 'User.can_edit_personal_information[users/models.py]', + 'User.can_view_personal_information[users/models.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT %s AS "a" + FROM "prescribers_prescribermembership" + INNER JOIN "users_user" ON ("prescribers_prescribermembership"."user_id" = "users_user"."id") + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active" + AND "prescribers_prescriberorganization"."is_authorized" + AND "users_user"."is_active") + LIMIT 1 + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + ]), + }) +# --- +# name: TestUpdateJobSeeker.test_as_unauthorized_prescriber_that_created_proxied_job_seeker_deprecated[queries - step 2] + dict({ + 'num_queries': 8, + 'queries': list([ + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE "users_user"."id" = %s + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "prescribers_prescribermembership"."id", + "prescribers_prescribermembership"."user_id", + "prescribers_prescribermembership"."joined_at", + "prescribers_prescribermembership"."is_admin", + "prescribers_prescribermembership"."is_active", + "prescribers_prescribermembership"."created_at", + "prescribers_prescribermembership"."updated_at", + "prescribers_prescribermembership"."organization_id", + "prescribers_prescribermembership"."updated_by_id", + "prescribers_prescriberorganization"."id", + "prescribers_prescriberorganization"."address_line_1", + "prescribers_prescriberorganization"."address_line_2", + "prescribers_prescriberorganization"."post_code", + "prescribers_prescriberorganization"."city", + "prescribers_prescriberorganization"."department", + "prescribers_prescriberorganization"."coords", + "prescribers_prescriberorganization"."geocoding_score", + "prescribers_prescriberorganization"."geocoding_updated_at", + "prescribers_prescriberorganization"."ban_api_resolved_address", + "prescribers_prescriberorganization"."insee_city_id", + "prescribers_prescriberorganization"."name", + "prescribers_prescriberorganization"."created_at", + "prescribers_prescriberorganization"."updated_at", + "prescribers_prescriberorganization"."uid", + "prescribers_prescriberorganization"."active_members_email_reminder_last_sent_at", + "prescribers_prescriberorganization"."automatic_geocoding_update", + "prescribers_prescriberorganization"."siret", + "prescribers_prescriberorganization"."is_head_office", + "prescribers_prescriberorganization"."kind", + "prescribers_prescriberorganization"."is_brsa", + "prescribers_prescriberorganization"."phone", + "prescribers_prescriberorganization"."email", + "prescribers_prescriberorganization"."website", + "prescribers_prescriberorganization"."description", + "prescribers_prescriberorganization"."is_authorized", + "prescribers_prescriberorganization"."code_safir_pole_emploi", + "prescribers_prescriberorganization"."created_by_id", + "prescribers_prescriberorganization"."authorization_status", + "prescribers_prescriberorganization"."authorization_updated_at", + "prescribers_prescriberorganization"."authorization_updated_by_id" + FROM "prescribers_prescribermembership" + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active") + ORDER BY "prescribers_prescribermembership"."created_at" ASC + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'DeprecatedUpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE ("users_user"."kind" = %s + AND "users_user"."public_id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'User.is_prescriber_with_authorized_org[users/models.py]', + 'User.can_edit_personal_information[users/models.py]', + 'User.can_view_personal_information[users/models.py]', + 'DeprecatedUpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT %s AS "a" + FROM "prescribers_prescribermembership" + INNER JOIN "users_user" ON ("prescribers_prescribermembership"."user_id" = "users_user"."id") + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active" + AND "prescribers_prescriberorganization"."is_authorized" + AND "users_user"."is_active") + LIMIT 1 + ''', + }), + dict({ + 'origin': list([ + 'DeprecatedUpdateJobSeekerStep2View.setup[www/apply/views/submit_views.py]', + 'DeprecatedUpdateJobSeekerStep2View.setup[utils/session.py]', + 'DeprecatedUpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + ]), + }) +# --- +# name: TestUpdateJobSeeker.test_as_unauthorized_prescriber_that_created_proxied_job_seeker_deprecated[queries - step 3] + dict({ + 'num_queries': 8, + 'queries': list([ + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE "users_user"."id" = %s + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "prescribers_prescribermembership"."id", + "prescribers_prescribermembership"."user_id", + "prescribers_prescribermembership"."joined_at", + "prescribers_prescribermembership"."is_admin", + "prescribers_prescribermembership"."is_active", + "prescribers_prescribermembership"."created_at", + "prescribers_prescribermembership"."updated_at", + "prescribers_prescribermembership"."organization_id", + "prescribers_prescribermembership"."updated_by_id", + "prescribers_prescriberorganization"."id", + "prescribers_prescriberorganization"."address_line_1", + "prescribers_prescriberorganization"."address_line_2", + "prescribers_prescriberorganization"."post_code", + "prescribers_prescriberorganization"."city", + "prescribers_prescriberorganization"."department", + "prescribers_prescriberorganization"."coords", + "prescribers_prescriberorganization"."geocoding_score", + "prescribers_prescriberorganization"."geocoding_updated_at", + "prescribers_prescriberorganization"."ban_api_resolved_address", + "prescribers_prescriberorganization"."insee_city_id", + "prescribers_prescriberorganization"."name", + "prescribers_prescriberorganization"."created_at", + "prescribers_prescriberorganization"."updated_at", + "prescribers_prescriberorganization"."uid", + "prescribers_prescriberorganization"."active_members_email_reminder_last_sent_at", + "prescribers_prescriberorganization"."automatic_geocoding_update", + "prescribers_prescriberorganization"."siret", + "prescribers_prescriberorganization"."is_head_office", + "prescribers_prescriberorganization"."kind", + "prescribers_prescriberorganization"."is_brsa", + "prescribers_prescriberorganization"."phone", + "prescribers_prescriberorganization"."email", + "prescribers_prescriberorganization"."website", + "prescribers_prescriberorganization"."description", + "prescribers_prescriberorganization"."is_authorized", + "prescribers_prescriberorganization"."code_safir_pole_emploi", + "prescribers_prescriberorganization"."created_by_id", + "prescribers_prescriberorganization"."authorization_status", + "prescribers_prescriberorganization"."authorization_updated_at", + "prescribers_prescriberorganization"."authorization_updated_by_id" + FROM "prescribers_prescribermembership" + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active") + ORDER BY "prescribers_prescribermembership"."created_at" ASC + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'DeprecatedUpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login", + "users_jobseekerprofile"."user_id", + "users_jobseekerprofile"."birthdate", + "users_jobseekerprofile"."birth_place_id", + "users_jobseekerprofile"."birth_country_id", + "users_jobseekerprofile"."nir", + "users_jobseekerprofile"."lack_of_nir_reason", + "users_jobseekerprofile"."pole_emploi_id", + "users_jobseekerprofile"."lack_of_pole_emploi_id_reason", + "users_jobseekerprofile"."asp_uid", + "users_jobseekerprofile"."education_level", + "users_jobseekerprofile"."resourceless", + "users_jobseekerprofile"."rqth_employee", + "users_jobseekerprofile"."oeth_employee", + "users_jobseekerprofile"."pole_emploi_since", + "users_jobseekerprofile"."unemployed_since", + "users_jobseekerprofile"."has_rsa_allocation", + "users_jobseekerprofile"."rsa_allocation_since", + "users_jobseekerprofile"."ass_allocation_since", + "users_jobseekerprofile"."aah_allocation_since", + "users_jobseekerprofile"."are_allocation_since", + "users_jobseekerprofile"."activity_bonus_since", + "users_jobseekerprofile"."cape_freelance", + "users_jobseekerprofile"."cesa_freelance", + "users_jobseekerprofile"."actor_met_for_business_creation", + "users_jobseekerprofile"."mean_monthly_income_before_process", + "users_jobseekerprofile"."eiti_contributions", + "users_jobseekerprofile"."hexa_lane_number", + "users_jobseekerprofile"."hexa_std_extension", + "users_jobseekerprofile"."hexa_non_std_extension", + "users_jobseekerprofile"."hexa_lane_type", + "users_jobseekerprofile"."hexa_lane_name", + "users_jobseekerprofile"."hexa_additional_address", + "users_jobseekerprofile"."hexa_post_code", + "users_jobseekerprofile"."hexa_commune_id", + "users_jobseekerprofile"."pe_obfuscated_nir", + "users_jobseekerprofile"."pe_last_certification_attempt_at" + FROM "users_user" + LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") + WHERE ("users_user"."kind" = %s + AND "users_user"."public_id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'User.is_prescriber_with_authorized_org[users/models.py]', + 'User.can_edit_personal_information[users/models.py]', + 'User.can_view_personal_information[users/models.py]', + 'DeprecatedUpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT %s AS "a" + FROM "prescribers_prescribermembership" + INNER JOIN "users_user" ON ("prescribers_prescribermembership"."user_id" = "users_user"."id") + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active" + AND "prescribers_prescriberorganization"."is_authorized" + AND "users_user"."is_active") + LIMIT 1 + ''', + }), + dict({ + 'origin': list([ + 'DeprecatedUpdateJobSeekerStep3View.setup[www/apply/views/submit_views.py]', + 'DeprecatedUpdateJobSeekerStep3View.setup[utils/session.py]', + 'DeprecatedUpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + ]), + }) +# --- +# name: TestUpdateJobSeeker.test_with_job_seeker_without_nir[queries - start] + dict({ + 'num_queries': 11, + 'queries': list([ + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE "users_user"."id" = %s + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "companies_companymembership"."id", + "companies_companymembership"."user_id", + "companies_companymembership"."joined_at", + "companies_companymembership"."is_admin", + "companies_companymembership"."is_active", + "companies_companymembership"."created_at", + "companies_companymembership"."updated_at", + "companies_companymembership"."company_id", + "companies_companymembership"."updated_by_id", + "companies_companymembership"."notifications" + FROM "companies_companymembership" + WHERE ("companies_companymembership"."user_id" = %s + AND "companies_companymembership"."is_active") + ORDER BY "companies_companymembership"."created_at" ASC + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."deactivated_at" >= %s + AND U0."id" = ("companies_company"."convention_id")) + LIMIT 1) AS "has_convention_in_grace_period", + "companies_siaeconvention"."id", + "companies_siaeconvention"."kind", + "companies_siaeconvention"."siret_signature", + "companies_siaeconvention"."is_active", + "companies_siaeconvention"."deactivated_at", + "companies_siaeconvention"."reactivated_by_id", + "companies_siaeconvention"."reactivated_at", + "companies_siaeconvention"."asp_id", + "companies_siaeconvention"."created_at", + "companies_siaeconvention"."updated_at" + FROM "companies_company" + INNER JOIN "companies_companymembership" ON ("companies_company"."id" = "companies_companymembership"."company_id") + LEFT OUTER JOIN "companies_siaeconvention" ON ("companies_company"."convention_id" = "companies_siaeconvention"."id") + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_companymembership"."user_id" = %s + AND "companies_company"."id" IN (%s) + AND (NOT ("companies_company"."kind" IN (%s, + %s, + %s, + %s, + %s)) + OR "companies_company"."source" = %s + OR EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."id" = ("companies_company"."convention_id") + AND U0."is_active") + LIMIT 1) + OR EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."deactivated_at" >= %s + AND U0."id" = ("companies_company"."convention_id")) + LIMIT 1))) + ORDER BY RANDOM() ASC + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStartView.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE ("users_user"."kind" = %s + AND "users_user"."public_id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStartView.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'Session.save[/django/db/models/base.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + UPDATE "django_session" + SET "session_data" = %s, + "expire_date" = %s + WHERE "django_session"."session_key" = %s + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + ]), + }) +# --- +# name: TestUpdateJobSeeker.test_with_job_seeker_without_nir[queries - step 1] + dict({ + 'num_queries': 14, + 'queries': list([ + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE "users_user"."id" = %s + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "companies_companymembership"."id", + "companies_companymembership"."user_id", + "companies_companymembership"."joined_at", + "companies_companymembership"."is_admin", + "companies_companymembership"."is_active", + "companies_companymembership"."created_at", + "companies_companymembership"."updated_at", + "companies_companymembership"."company_id", + "companies_companymembership"."updated_by_id", + "companies_companymembership"."notifications" + FROM "companies_companymembership" + WHERE ("companies_companymembership"."user_id" = %s + AND "companies_companymembership"."is_active") + ORDER BY "companies_companymembership"."created_at" ASC + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."deactivated_at" >= %s + AND U0."id" = ("companies_company"."convention_id")) + LIMIT 1) AS "has_convention_in_grace_period", + "companies_siaeconvention"."id", + "companies_siaeconvention"."kind", + "companies_siaeconvention"."siret_signature", + "companies_siaeconvention"."is_active", + "companies_siaeconvention"."deactivated_at", + "companies_siaeconvention"."reactivated_by_id", + "companies_siaeconvention"."reactivated_at", + "companies_siaeconvention"."asp_id", + "companies_siaeconvention"."created_at", + "companies_siaeconvention"."updated_at" + FROM "companies_company" + INNER JOIN "companies_companymembership" ON ("companies_company"."id" = "companies_companymembership"."company_id") + LEFT OUTER JOIN "companies_siaeconvention" ON ("companies_company"."convention_id" = "companies_siaeconvention"."id") + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_companymembership"."user_id" = %s + AND "companies_company"."id" IN (%s) + AND (NOT ("companies_company"."kind" IN (%s, + %s, + %s, + %s, + %s)) + OR "companies_company"."source" = %s + OR EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."id" = ("companies_company"."convention_id") + AND U0."is_active") + LIMIT 1) + OR EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."deactivated_at" >= %s + AND U0."id" = ("companies_company"."convention_id")) + LIMIT 1))) + ORDER BY RANDOM() ASC + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login", + "users_jobseekerprofile"."user_id", + "users_jobseekerprofile"."birthdate", + "users_jobseekerprofile"."birth_place_id", + "users_jobseekerprofile"."birth_country_id", + "users_jobseekerprofile"."nir", + "users_jobseekerprofile"."lack_of_nir_reason", + "users_jobseekerprofile"."pole_emploi_id", + "users_jobseekerprofile"."lack_of_pole_emploi_id_reason", + "users_jobseekerprofile"."asp_uid", + "users_jobseekerprofile"."education_level", + "users_jobseekerprofile"."resourceless", + "users_jobseekerprofile"."rqth_employee", + "users_jobseekerprofile"."oeth_employee", + "users_jobseekerprofile"."pole_emploi_since", + "users_jobseekerprofile"."unemployed_since", + "users_jobseekerprofile"."has_rsa_allocation", + "users_jobseekerprofile"."rsa_allocation_since", + "users_jobseekerprofile"."ass_allocation_since", + "users_jobseekerprofile"."aah_allocation_since", + "users_jobseekerprofile"."are_allocation_since", + "users_jobseekerprofile"."activity_bonus_since", + "users_jobseekerprofile"."cape_freelance", + "users_jobseekerprofile"."cesa_freelance", + "users_jobseekerprofile"."actor_met_for_business_creation", + "users_jobseekerprofile"."mean_monthly_income_before_process", + "users_jobseekerprofile"."eiti_contributions", + "users_jobseekerprofile"."hexa_lane_number", + "users_jobseekerprofile"."hexa_std_extension", + "users_jobseekerprofile"."hexa_non_std_extension", + "users_jobseekerprofile"."hexa_lane_type", + "users_jobseekerprofile"."hexa_lane_name", + "users_jobseekerprofile"."hexa_additional_address", + "users_jobseekerprofile"."hexa_post_code", + "users_jobseekerprofile"."hexa_commune_id", + "users_jobseekerprofile"."pe_obfuscated_nir", + "users_jobseekerprofile"."pe_last_certification_attempt_at" + FROM "users_user" + LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") + WHERE ("users_user"."kind" = %s + AND "users_user"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'Company.has_admin[common_apps/organizations/models.py]', + 'Company.convention_can_be_accessed_by[companies/models.py]', + 'nav[utils/templatetags/nav.py]', + 'InclusionNode[layout/_header_authenticated.html]', + 'IncludeNode[layout/base.html]', + 'IfNode[layout/base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', + ]), + 'sql': ''' + SELECT %s AS "a" + FROM "users_user" + INNER JOIN "companies_companymembership" ON ("users_user"."id" = "companies_companymembership"."user_id") + WHERE ("companies_companymembership"."id" IN + (SELECT U0."id" + FROM "companies_companymembership" U0 + INNER JOIN "users_user" U2 ON (U0."user_id" = U2."id") + WHERE (U0."company_id" = %s + AND U2."is_active" + AND U0."is_active" + AND U0."is_admin" + AND U2."is_active")) + AND "users_user"."id" = %s) + LIMIT 1 + ''', + }), + dict({ + 'origin': list([ + 'CustomFieldRenderer.render[utils/custom_renderer.py]', + 'SimpleNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', + 'IfNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', + 'BlockNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', + 'BlockNode[layout/base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', + ]), + 'sql': ''' + SELECT "asp_country"."id", + "asp_country"."code", + "asp_country"."name", + "asp_country"."group", + "asp_country"."department" + FROM "asp_country" + ORDER BY "asp_country"."name" ASC + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'Session.save[/django/db/models/base.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + UPDATE "django_session" + SET "session_data" = %s, + "expire_date" = %s + WHERE "django_session"."session_key" = %s + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + ]), + }) +# --- +# name: TestUpdateJobSeeker.test_with_job_seeker_without_nir[queries - step 2] + dict({ + 'num_queries': 10, + 'queries': list([ + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE "users_user"."id" = %s + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "companies_companymembership"."id", + "companies_companymembership"."user_id", + "companies_companymembership"."joined_at", + "companies_companymembership"."is_admin", + "companies_companymembership"."is_active", + "companies_companymembership"."created_at", + "companies_companymembership"."updated_at", + "companies_companymembership"."company_id", + "companies_companymembership"."updated_by_id", + "companies_companymembership"."notifications" + FROM "companies_companymembership" + WHERE ("companies_companymembership"."user_id" = %s + AND "companies_companymembership"."is_active") + ORDER BY "companies_companymembership"."created_at" ASC + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."deactivated_at" >= %s + AND U0."id" = ("companies_company"."convention_id")) + LIMIT 1) AS "has_convention_in_grace_period", + "companies_siaeconvention"."id", + "companies_siaeconvention"."kind", + "companies_siaeconvention"."siret_signature", + "companies_siaeconvention"."is_active", + "companies_siaeconvention"."deactivated_at", + "companies_siaeconvention"."reactivated_by_id", + "companies_siaeconvention"."reactivated_at", + "companies_siaeconvention"."asp_id", + "companies_siaeconvention"."created_at", + "companies_siaeconvention"."updated_at" + FROM "companies_company" + INNER JOIN "companies_companymembership" ON ("companies_company"."id" = "companies_companymembership"."company_id") + LEFT OUTER JOIN "companies_siaeconvention" ON ("companies_company"."convention_id" = "companies_siaeconvention"."id") + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_companymembership"."user_id" = %s + AND "companies_company"."id" IN (%s) + AND (NOT ("companies_company"."kind" IN (%s, + %s, + %s, + %s, + %s)) + OR "companies_company"."source" = %s + OR EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."id" = ("companies_company"."convention_id") + AND U0."is_active") + LIMIT 1) + OR EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."deactivated_at" >= %s + AND U0."id" = ("companies_company"."convention_id")) + LIMIT 1))) + ORDER BY RANDOM() ASC + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE ("users_user"."kind" = %s + AND "users_user"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'Company.has_admin[common_apps/organizations/models.py]', + 'Company.convention_can_be_accessed_by[companies/models.py]', + 'nav[utils/templatetags/nav.py]', + 'InclusionNode[layout/_header_authenticated.html]', + 'IncludeNode[layout/base.html]', + 'IfNode[layout/base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_2.html]', + ]), + 'sql': ''' + SELECT %s AS "a" + FROM "users_user" + INNER JOIN "companies_companymembership" ON ("users_user"."id" = "companies_companymembership"."user_id") + WHERE ("companies_companymembership"."id" IN + (SELECT U0."id" + FROM "companies_companymembership" U0 + INNER JOIN "users_user" U2 ON (U0."user_id" = U2."id") + WHERE (U0."company_id" = %s + AND U2."is_active" + AND U0."is_active" + AND U0."is_admin" + AND U2."is_active")) + AND "users_user"."id" = %s) + LIMIT 1 + ''', + }), + ]), + }) +# --- +# name: TestUpdateJobSeeker.test_with_job_seeker_without_nir[queries - step 3] + dict({ + 'num_queries': 10, + 'queries': list([ + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE "users_user"."id" = %s + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "companies_companymembership"."id", + "companies_companymembership"."user_id", + "companies_companymembership"."joined_at", + "companies_companymembership"."is_admin", + "companies_companymembership"."is_active", + "companies_companymembership"."created_at", + "companies_companymembership"."updated_at", + "companies_companymembership"."company_id", + "companies_companymembership"."updated_by_id", + "companies_companymembership"."notifications" + FROM "companies_companymembership" + WHERE ("companies_companymembership"."user_id" = %s + AND "companies_companymembership"."is_active") + ORDER BY "companies_companymembership"."created_at" ASC + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."deactivated_at" >= %s + AND U0."id" = ("companies_company"."convention_id")) + LIMIT 1) AS "has_convention_in_grace_period", + "companies_siaeconvention"."id", + "companies_siaeconvention"."kind", + "companies_siaeconvention"."siret_signature", + "companies_siaeconvention"."is_active", + "companies_siaeconvention"."deactivated_at", + "companies_siaeconvention"."reactivated_by_id", + "companies_siaeconvention"."reactivated_at", + "companies_siaeconvention"."asp_id", + "companies_siaeconvention"."created_at", + "companies_siaeconvention"."updated_at" + FROM "companies_company" + INNER JOIN "companies_companymembership" ON ("companies_company"."id" = "companies_companymembership"."company_id") + LEFT OUTER JOIN "companies_siaeconvention" ON ("companies_company"."convention_id" = "companies_siaeconvention"."id") + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_companymembership"."user_id" = %s + AND "companies_company"."id" IN (%s) + AND (NOT ("companies_company"."kind" IN (%s, + %s, + %s, + %s, + %s)) + OR "companies_company"."source" = %s + OR EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."id" = ("companies_company"."convention_id") + AND U0."is_active") + LIMIT 1) + OR EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."deactivated_at" >= %s + AND U0."id" = ("companies_company"."convention_id")) + LIMIT 1))) + ORDER BY RANDOM() ASC + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login", + "users_jobseekerprofile"."user_id", + "users_jobseekerprofile"."birthdate", + "users_jobseekerprofile"."birth_place_id", + "users_jobseekerprofile"."birth_country_id", + "users_jobseekerprofile"."nir", + "users_jobseekerprofile"."lack_of_nir_reason", + "users_jobseekerprofile"."pole_emploi_id", + "users_jobseekerprofile"."lack_of_pole_emploi_id_reason", + "users_jobseekerprofile"."asp_uid", + "users_jobseekerprofile"."education_level", + "users_jobseekerprofile"."resourceless", + "users_jobseekerprofile"."rqth_employee", + "users_jobseekerprofile"."oeth_employee", + "users_jobseekerprofile"."pole_emploi_since", + "users_jobseekerprofile"."unemployed_since", + "users_jobseekerprofile"."has_rsa_allocation", + "users_jobseekerprofile"."rsa_allocation_since", + "users_jobseekerprofile"."ass_allocation_since", + "users_jobseekerprofile"."aah_allocation_since", + "users_jobseekerprofile"."are_allocation_since", + "users_jobseekerprofile"."activity_bonus_since", + "users_jobseekerprofile"."cape_freelance", + "users_jobseekerprofile"."cesa_freelance", + "users_jobseekerprofile"."actor_met_for_business_creation", + "users_jobseekerprofile"."mean_monthly_income_before_process", + "users_jobseekerprofile"."eiti_contributions", + "users_jobseekerprofile"."hexa_lane_number", + "users_jobseekerprofile"."hexa_std_extension", + "users_jobseekerprofile"."hexa_non_std_extension", + "users_jobseekerprofile"."hexa_lane_type", + "users_jobseekerprofile"."hexa_lane_name", + "users_jobseekerprofile"."hexa_additional_address", + "users_jobseekerprofile"."hexa_post_code", + "users_jobseekerprofile"."hexa_commune_id", + "users_jobseekerprofile"."pe_obfuscated_nir", + "users_jobseekerprofile"."pe_last_certification_attempt_at" + FROM "users_user" + LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") + WHERE ("users_user"."kind" = %s + AND "users_user"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'Company.has_admin[common_apps/organizations/models.py]', + 'Company.convention_can_be_accessed_by[companies/models.py]', + 'nav[utils/templatetags/nav.py]', + 'InclusionNode[layout/_header_authenticated.html]', + 'IncludeNode[layout/base.html]', + 'IfNode[layout/base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_3.html]', + ]), + 'sql': ''' + SELECT %s AS "a" + FROM "users_user" + INNER JOIN "companies_companymembership" ON ("users_user"."id" = "companies_companymembership"."user_id") + WHERE ("companies_companymembership"."id" IN + (SELECT U0."id" + FROM "companies_companymembership" U0 + INNER JOIN "users_user" U2 ON (U0."user_id" = U2."id") + WHERE (U0."company_id" = %s + AND U2."is_active" + AND U0."is_active" + AND U0."is_admin" + AND U2."is_active")) + AND "users_user"."id" = %s) + LIMIT 1 + ''', + }), + ]), + }) +# --- +# name: TestUpdateJobSeeker.test_with_job_seeker_without_nir_deprecated[queries - step 2] + dict({ + 'num_queries': 9, + 'queries': list([ + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE "users_user"."id" = %s + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "companies_companymembership"."id", + "companies_companymembership"."user_id", + "companies_companymembership"."joined_at", + "companies_companymembership"."is_admin", + "companies_companymembership"."is_active", + "companies_companymembership"."created_at", + "companies_companymembership"."updated_at", + "companies_companymembership"."company_id", + "companies_companymembership"."updated_by_id", + "companies_companymembership"."notifications" + FROM "companies_companymembership" + WHERE ("companies_companymembership"."user_id" = %s + AND "companies_companymembership"."is_active") + ORDER BY "companies_companymembership"."created_at" ASC + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."deactivated_at" >= %s + AND U0."id" = ("companies_company"."convention_id")) + LIMIT 1) AS "has_convention_in_grace_period", + "companies_siaeconvention"."id", + "companies_siaeconvention"."kind", + "companies_siaeconvention"."siret_signature", + "companies_siaeconvention"."is_active", + "companies_siaeconvention"."deactivated_at", + "companies_siaeconvention"."reactivated_by_id", + "companies_siaeconvention"."reactivated_at", + "companies_siaeconvention"."asp_id", + "companies_siaeconvention"."created_at", + "companies_siaeconvention"."updated_at" + FROM "companies_company" + INNER JOIN "companies_companymembership" ON ("companies_company"."id" = "companies_companymembership"."company_id") + LEFT OUTER JOIN "companies_siaeconvention" ON ("companies_company"."convention_id" = "companies_siaeconvention"."id") + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_companymembership"."user_id" = %s + AND "companies_company"."id" IN (%s) + AND (NOT ("companies_company"."kind" IN (%s, + %s, + %s, + %s, + %s)) + OR "companies_company"."source" = %s + OR EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."id" = ("companies_company"."convention_id") + AND U0."is_active") + LIMIT 1) + OR EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."deactivated_at" >= %s + AND U0."id" = ("companies_company"."convention_id")) + LIMIT 1))) + ORDER BY RANDOM() ASC + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'DeprecatedUpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE ("users_user"."kind" = %s + AND "users_user"."public_id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'DeprecatedUpdateJobSeekerStep2View.setup[www/apply/views/submit_views.py]', + 'DeprecatedUpdateJobSeekerStep2View.setup[utils/session.py]', + 'DeprecatedUpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'Company.has_admin[common_apps/organizations/models.py]', + 'Company.convention_can_be_accessed_by[companies/models.py]', + 'nav[utils/templatetags/nav.py]', + 'InclusionNode[layout/_header_authenticated.html]', + 'IncludeNode[layout/base.html]', + 'IfNode[layout/base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_2.html]', + ]), + 'sql': ''' + SELECT %s AS "a" + FROM "users_user" + INNER JOIN "companies_companymembership" ON ("users_user"."id" = "companies_companymembership"."user_id") + WHERE ("companies_companymembership"."id" IN + (SELECT U0."id" + FROM "companies_companymembership" U0 + INNER JOIN "users_user" U2 ON (U0."user_id" = U2."id") + WHERE (U0."company_id" = %s + AND U2."is_active" + AND U0."is_active" + AND U0."is_admin" + AND U2."is_active")) + AND "users_user"."id" = %s) + LIMIT 1 + ''', + }), + ]), + }) +# --- +# name: TestUpdateJobSeeker.test_with_job_seeker_without_nir_deprecated[queries - step 3] + dict({ + 'num_queries': 9, + 'queries': list([ + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE "users_user"."id" = %s + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "companies_companymembership"."id", + "companies_companymembership"."user_id", + "companies_companymembership"."joined_at", + "companies_companymembership"."is_admin", + "companies_companymembership"."is_active", + "companies_companymembership"."created_at", + "companies_companymembership"."updated_at", + "companies_companymembership"."company_id", + "companies_companymembership"."updated_by_id", + "companies_companymembership"."notifications" + FROM "companies_companymembership" + WHERE ("companies_companymembership"."user_id" = %s + AND "companies_companymembership"."is_active") + ORDER BY "companies_companymembership"."created_at" ASC + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."deactivated_at" >= %s + AND U0."id" = ("companies_company"."convention_id")) + LIMIT 1) AS "has_convention_in_grace_period", + "companies_siaeconvention"."id", + "companies_siaeconvention"."kind", + "companies_siaeconvention"."siret_signature", + "companies_siaeconvention"."is_active", + "companies_siaeconvention"."deactivated_at", + "companies_siaeconvention"."reactivated_by_id", + "companies_siaeconvention"."reactivated_at", + "companies_siaeconvention"."asp_id", + "companies_siaeconvention"."created_at", + "companies_siaeconvention"."updated_at" + FROM "companies_company" + INNER JOIN "companies_companymembership" ON ("companies_company"."id" = "companies_companymembership"."company_id") + LEFT OUTER JOIN "companies_siaeconvention" ON ("companies_company"."convention_id" = "companies_siaeconvention"."id") + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_companymembership"."user_id" = %s + AND "companies_company"."id" IN (%s) + AND (NOT ("companies_company"."kind" IN (%s, + %s, + %s, + %s, + %s)) + OR "companies_company"."source" = %s + OR EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."id" = ("companies_company"."convention_id") + AND U0."is_active") + LIMIT 1) + OR EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."deactivated_at" >= %s + AND U0."id" = ("companies_company"."convention_id")) + LIMIT 1))) + ORDER BY RANDOM() ASC + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'DeprecatedUpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login", + "users_jobseekerprofile"."user_id", + "users_jobseekerprofile"."birthdate", + "users_jobseekerprofile"."birth_place_id", + "users_jobseekerprofile"."birth_country_id", + "users_jobseekerprofile"."nir", + "users_jobseekerprofile"."lack_of_nir_reason", + "users_jobseekerprofile"."pole_emploi_id", + "users_jobseekerprofile"."lack_of_pole_emploi_id_reason", + "users_jobseekerprofile"."asp_uid", + "users_jobseekerprofile"."education_level", + "users_jobseekerprofile"."resourceless", + "users_jobseekerprofile"."rqth_employee", + "users_jobseekerprofile"."oeth_employee", + "users_jobseekerprofile"."pole_emploi_since", + "users_jobseekerprofile"."unemployed_since", + "users_jobseekerprofile"."has_rsa_allocation", + "users_jobseekerprofile"."rsa_allocation_since", + "users_jobseekerprofile"."ass_allocation_since", + "users_jobseekerprofile"."aah_allocation_since", + "users_jobseekerprofile"."are_allocation_since", + "users_jobseekerprofile"."activity_bonus_since", + "users_jobseekerprofile"."cape_freelance", + "users_jobseekerprofile"."cesa_freelance", + "users_jobseekerprofile"."actor_met_for_business_creation", + "users_jobseekerprofile"."mean_monthly_income_before_process", + "users_jobseekerprofile"."eiti_contributions", + "users_jobseekerprofile"."hexa_lane_number", + "users_jobseekerprofile"."hexa_std_extension", + "users_jobseekerprofile"."hexa_non_std_extension", + "users_jobseekerprofile"."hexa_lane_type", + "users_jobseekerprofile"."hexa_lane_name", + "users_jobseekerprofile"."hexa_additional_address", + "users_jobseekerprofile"."hexa_post_code", + "users_jobseekerprofile"."hexa_commune_id", + "users_jobseekerprofile"."pe_obfuscated_nir", + "users_jobseekerprofile"."pe_last_certification_attempt_at" + FROM "users_user" + LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") + WHERE ("users_user"."kind" = %s + AND "users_user"."public_id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'DeprecatedUpdateJobSeekerStep3View.setup[www/apply/views/submit_views.py]', + 'DeprecatedUpdateJobSeekerStep3View.setup[utils/session.py]', + 'DeprecatedUpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'Company.has_admin[common_apps/organizations/models.py]', + 'Company.convention_can_be_accessed_by[companies/models.py]', + 'nav[utils/templatetags/nav.py]', + 'InclusionNode[layout/_header_authenticated.html]', + 'IncludeNode[layout/base.html]', + 'IfNode[layout/base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_3.html]', + ]), + 'sql': ''' + SELECT %s AS "a" + FROM "users_user" + INNER JOIN "companies_companymembership" ON ("users_user"."id" = "companies_companymembership"."user_id") + WHERE ("companies_companymembership"."id" IN + (SELECT U0."id" + FROM "companies_companymembership" U0 + INNER JOIN "users_user" U2 ON (U0."user_id" = U2."id") + WHERE (U0."company_id" = %s + AND U2."is_active" + AND U0."is_active" + AND U0."is_admin" + AND U2."is_active")) + AND "users_user"."id" = %s) + LIMIT 1 + ''', + }), + ]), + }) +# --- +# name: TestUpdateJobSeekerForHire.test_as_authorized_prescriber_with_proxied_job_seeker[queries - start] + dict({ + 'num_queries': 11, + 'queries': list([ + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE "users_user"."id" = %s + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "prescribers_prescribermembership"."id", + "prescribers_prescribermembership"."user_id", + "prescribers_prescribermembership"."joined_at", + "prescribers_prescribermembership"."is_admin", + "prescribers_prescribermembership"."is_active", + "prescribers_prescribermembership"."created_at", + "prescribers_prescribermembership"."updated_at", + "prescribers_prescribermembership"."organization_id", + "prescribers_prescribermembership"."updated_by_id", + "prescribers_prescriberorganization"."id", + "prescribers_prescriberorganization"."address_line_1", + "prescribers_prescriberorganization"."address_line_2", + "prescribers_prescriberorganization"."post_code", + "prescribers_prescriberorganization"."city", + "prescribers_prescriberorganization"."department", + "prescribers_prescriberorganization"."coords", + "prescribers_prescriberorganization"."geocoding_score", + "prescribers_prescriberorganization"."geocoding_updated_at", + "prescribers_prescriberorganization"."ban_api_resolved_address", + "prescribers_prescriberorganization"."insee_city_id", + "prescribers_prescriberorganization"."name", + "prescribers_prescriberorganization"."created_at", + "prescribers_prescriberorganization"."updated_at", + "prescribers_prescriberorganization"."uid", + "prescribers_prescriberorganization"."active_members_email_reminder_last_sent_at", + "prescribers_prescriberorganization"."automatic_geocoding_update", + "prescribers_prescriberorganization"."siret", + "prescribers_prescriberorganization"."is_head_office", + "prescribers_prescriberorganization"."kind", + "prescribers_prescriberorganization"."is_brsa", + "prescribers_prescriberorganization"."phone", + "prescribers_prescriberorganization"."email", + "prescribers_prescriberorganization"."website", + "prescribers_prescriberorganization"."description", + "prescribers_prescriberorganization"."is_authorized", + "prescribers_prescriberorganization"."code_safir_pole_emploi", + "prescribers_prescriberorganization"."created_by_id", + "prescribers_prescriberorganization"."authorization_status", + "prescribers_prescriberorganization"."authorization_updated_at", + "prescribers_prescriberorganization"."authorization_updated_by_id" + FROM "prescribers_prescribermembership" + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active") + ORDER BY "prescribers_prescribermembership"."created_at" ASC + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStartView.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE ("users_user"."kind" = %s + AND "users_user"."public_id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStartView.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'User.is_prescriber_with_authorized_org[users/models.py]', + 'User.can_edit_personal_information[users/models.py]', + 'User.can_view_personal_information[users/models.py]', + 'UpdateJobSeekerStartView.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT %s AS "a" + FROM "prescribers_prescribermembership" + INNER JOIN "users_user" ON ("prescribers_prescribermembership"."user_id" = "users_user"."id") + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active" + AND "prescribers_prescriberorganization"."is_authorized" + AND "users_user"."is_active") + LIMIT 1 + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'Session.save[/django/db/models/base.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + UPDATE "django_session" + SET "session_data" = %s, + "expire_date" = %s + WHERE "django_session"."session_key" = %s + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + ]), + }) +# --- +# name: TestUpdateJobSeekerForHire.test_as_authorized_prescriber_with_proxied_job_seeker[queries - step 1] + dict({ + 'num_queries': 13, + 'queries': list([ + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE "users_user"."id" = %s + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "prescribers_prescribermembership"."id", + "prescribers_prescribermembership"."user_id", + "prescribers_prescribermembership"."joined_at", + "prescribers_prescribermembership"."is_admin", + "prescribers_prescribermembership"."is_active", + "prescribers_prescribermembership"."created_at", + "prescribers_prescribermembership"."updated_at", + "prescribers_prescribermembership"."organization_id", + "prescribers_prescribermembership"."updated_by_id", + "prescribers_prescriberorganization"."id", + "prescribers_prescriberorganization"."address_line_1", + "prescribers_prescriberorganization"."address_line_2", + "prescribers_prescriberorganization"."post_code", + "prescribers_prescriberorganization"."city", + "prescribers_prescriberorganization"."department", + "prescribers_prescriberorganization"."coords", + "prescribers_prescriberorganization"."geocoding_score", + "prescribers_prescriberorganization"."geocoding_updated_at", + "prescribers_prescriberorganization"."ban_api_resolved_address", + "prescribers_prescriberorganization"."insee_city_id", + "prescribers_prescriberorganization"."name", + "prescribers_prescriberorganization"."created_at", + "prescribers_prescriberorganization"."updated_at", + "prescribers_prescriberorganization"."uid", + "prescribers_prescriberorganization"."active_members_email_reminder_last_sent_at", + "prescribers_prescriberorganization"."automatic_geocoding_update", + "prescribers_prescriberorganization"."siret", + "prescribers_prescriberorganization"."is_head_office", + "prescribers_prescriberorganization"."kind", + "prescribers_prescriberorganization"."is_brsa", + "prescribers_prescriberorganization"."phone", + "prescribers_prescriberorganization"."email", + "prescribers_prescriberorganization"."website", + "prescribers_prescriberorganization"."description", + "prescribers_prescriberorganization"."is_authorized", + "prescribers_prescriberorganization"."code_safir_pole_emploi", + "prescribers_prescriberorganization"."created_by_id", + "prescribers_prescriberorganization"."authorization_status", + "prescribers_prescriberorganization"."authorization_updated_at", + "prescribers_prescriberorganization"."authorization_updated_by_id" + FROM "prescribers_prescribermembership" + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active") + ORDER BY "prescribers_prescribermembership"."created_at" ASC + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login", + "users_jobseekerprofile"."user_id", + "users_jobseekerprofile"."birthdate", + "users_jobseekerprofile"."birth_place_id", + "users_jobseekerprofile"."birth_country_id", + "users_jobseekerprofile"."nir", + "users_jobseekerprofile"."lack_of_nir_reason", + "users_jobseekerprofile"."pole_emploi_id", + "users_jobseekerprofile"."lack_of_pole_emploi_id_reason", + "users_jobseekerprofile"."asp_uid", + "users_jobseekerprofile"."education_level", + "users_jobseekerprofile"."resourceless", + "users_jobseekerprofile"."rqth_employee", + "users_jobseekerprofile"."oeth_employee", + "users_jobseekerprofile"."pole_emploi_since", + "users_jobseekerprofile"."unemployed_since", + "users_jobseekerprofile"."has_rsa_allocation", + "users_jobseekerprofile"."rsa_allocation_since", + "users_jobseekerprofile"."ass_allocation_since", + "users_jobseekerprofile"."aah_allocation_since", + "users_jobseekerprofile"."are_allocation_since", + "users_jobseekerprofile"."activity_bonus_since", + "users_jobseekerprofile"."cape_freelance", + "users_jobseekerprofile"."cesa_freelance", + "users_jobseekerprofile"."actor_met_for_business_creation", + "users_jobseekerprofile"."mean_monthly_income_before_process", + "users_jobseekerprofile"."eiti_contributions", + "users_jobseekerprofile"."hexa_lane_number", + "users_jobseekerprofile"."hexa_std_extension", + "users_jobseekerprofile"."hexa_non_std_extension", + "users_jobseekerprofile"."hexa_lane_type", + "users_jobseekerprofile"."hexa_lane_name", + "users_jobseekerprofile"."hexa_additional_address", + "users_jobseekerprofile"."hexa_post_code", + "users_jobseekerprofile"."hexa_commune_id", + "users_jobseekerprofile"."pe_obfuscated_nir", + "users_jobseekerprofile"."pe_last_certification_attempt_at" + FROM "users_user" + LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") + WHERE ("users_user"."kind" = %s + AND "users_user"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'User.is_prescriber_with_authorized_org[users/models.py]', + 'User.can_edit_personal_information[users/models.py]', + 'User.can_view_personal_information[users/models.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT %s AS "a" + FROM "prescribers_prescribermembership" + INNER JOIN "users_user" ON ("prescribers_prescribermembership"."user_id" = "users_user"."id") + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active" + AND "prescribers_prescriberorganization"."is_authorized" + AND "users_user"."is_active") + LIMIT 1 + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'CustomFieldRenderer.render[utils/custom_renderer.py]', + 'SimpleNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', + 'IfNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', + 'BlockNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', + 'BlockNode[layout/base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', + ]), + 'sql': ''' + SELECT "asp_country"."id", + "asp_country"."code", + "asp_country"."name", + "asp_country"."group", + "asp_country"."department" + FROM "asp_country" + ORDER BY "asp_country"."name" ASC + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'Session.save[/django/db/models/base.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + UPDATE "django_session" + SET "session_data" = %s, + "expire_date" = %s + WHERE "django_session"."session_key" = %s + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + ]), + }) +# --- +# name: TestUpdateJobSeekerForHire.test_as_authorized_prescriber_with_proxied_job_seeker[queries - step 2] + dict({ + 'num_queries': 9, + 'queries': list([ + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE "users_user"."id" = %s + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "prescribers_prescribermembership"."id", + "prescribers_prescribermembership"."user_id", + "prescribers_prescribermembership"."joined_at", + "prescribers_prescribermembership"."is_admin", + "prescribers_prescribermembership"."is_active", + "prescribers_prescribermembership"."created_at", + "prescribers_prescribermembership"."updated_at", + "prescribers_prescribermembership"."organization_id", + "prescribers_prescribermembership"."updated_by_id", + "prescribers_prescriberorganization"."id", + "prescribers_prescriberorganization"."address_line_1", + "prescribers_prescriberorganization"."address_line_2", + "prescribers_prescriberorganization"."post_code", + "prescribers_prescriberorganization"."city", + "prescribers_prescriberorganization"."department", + "prescribers_prescriberorganization"."coords", + "prescribers_prescriberorganization"."geocoding_score", + "prescribers_prescriberorganization"."geocoding_updated_at", + "prescribers_prescriberorganization"."ban_api_resolved_address", + "prescribers_prescriberorganization"."insee_city_id", + "prescribers_prescriberorganization"."name", + "prescribers_prescriberorganization"."created_at", + "prescribers_prescriberorganization"."updated_at", + "prescribers_prescriberorganization"."uid", + "prescribers_prescriberorganization"."active_members_email_reminder_last_sent_at", + "prescribers_prescriberorganization"."automatic_geocoding_update", + "prescribers_prescriberorganization"."siret", + "prescribers_prescriberorganization"."is_head_office", + "prescribers_prescriberorganization"."kind", + "prescribers_prescriberorganization"."is_brsa", + "prescribers_prescriberorganization"."phone", + "prescribers_prescriberorganization"."email", + "prescribers_prescriberorganization"."website", + "prescribers_prescriberorganization"."description", + "prescribers_prescriberorganization"."is_authorized", + "prescribers_prescriberorganization"."code_safir_pole_emploi", + "prescribers_prescriberorganization"."created_by_id", + "prescribers_prescriberorganization"."authorization_status", + "prescribers_prescriberorganization"."authorization_updated_at", + "prescribers_prescriberorganization"."authorization_updated_by_id" + FROM "prescribers_prescribermembership" + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active") + ORDER BY "prescribers_prescribermembership"."created_at" ASC + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE ("users_user"."kind" = %s + AND "users_user"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'User.is_prescriber_with_authorized_org[users/models.py]', + 'User.can_edit_personal_information[users/models.py]', + 'User.can_view_personal_information[users/models.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT %s AS "a" + FROM "prescribers_prescribermembership" + INNER JOIN "users_user" ON ("prescribers_prescribermembership"."user_id" = "users_user"."id") + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active" + AND "prescribers_prescriberorganization"."is_authorized" + AND "users_user"."is_active") + LIMIT 1 + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + ]), + }) +# --- +# name: TestUpdateJobSeekerForHire.test_as_authorized_prescriber_with_proxied_job_seeker[queries - step 3] + dict({ + 'num_queries': 9, + 'queries': list([ + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE "users_user"."id" = %s + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "prescribers_prescribermembership"."id", + "prescribers_prescribermembership"."user_id", + "prescribers_prescribermembership"."joined_at", + "prescribers_prescribermembership"."is_admin", + "prescribers_prescribermembership"."is_active", + "prescribers_prescribermembership"."created_at", + "prescribers_prescribermembership"."updated_at", + "prescribers_prescribermembership"."organization_id", + "prescribers_prescribermembership"."updated_by_id", + "prescribers_prescriberorganization"."id", + "prescribers_prescriberorganization"."address_line_1", + "prescribers_prescriberorganization"."address_line_2", + "prescribers_prescriberorganization"."post_code", + "prescribers_prescriberorganization"."city", + "prescribers_prescriberorganization"."department", + "prescribers_prescriberorganization"."coords", + "prescribers_prescriberorganization"."geocoding_score", + "prescribers_prescriberorganization"."geocoding_updated_at", + "prescribers_prescriberorganization"."ban_api_resolved_address", + "prescribers_prescriberorganization"."insee_city_id", + "prescribers_prescriberorganization"."name", + "prescribers_prescriberorganization"."created_at", + "prescribers_prescriberorganization"."updated_at", + "prescribers_prescriberorganization"."uid", + "prescribers_prescriberorganization"."active_members_email_reminder_last_sent_at", + "prescribers_prescriberorganization"."automatic_geocoding_update", + "prescribers_prescriberorganization"."siret", + "prescribers_prescriberorganization"."is_head_office", + "prescribers_prescriberorganization"."kind", + "prescribers_prescriberorganization"."is_brsa", + "prescribers_prescriberorganization"."phone", + "prescribers_prescriberorganization"."email", + "prescribers_prescriberorganization"."website", + "prescribers_prescriberorganization"."description", + "prescribers_prescriberorganization"."is_authorized", + "prescribers_prescriberorganization"."code_safir_pole_emploi", + "prescribers_prescriberorganization"."created_by_id", + "prescribers_prescriberorganization"."authorization_status", + "prescribers_prescriberorganization"."authorization_updated_at", + "prescribers_prescriberorganization"."authorization_updated_by_id" + FROM "prescribers_prescribermembership" + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active") + ORDER BY "prescribers_prescribermembership"."created_at" ASC + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login", + "users_jobseekerprofile"."user_id", + "users_jobseekerprofile"."birthdate", + "users_jobseekerprofile"."birth_place_id", + "users_jobseekerprofile"."birth_country_id", + "users_jobseekerprofile"."nir", + "users_jobseekerprofile"."lack_of_nir_reason", + "users_jobseekerprofile"."pole_emploi_id", + "users_jobseekerprofile"."lack_of_pole_emploi_id_reason", + "users_jobseekerprofile"."asp_uid", + "users_jobseekerprofile"."education_level", + "users_jobseekerprofile"."resourceless", + "users_jobseekerprofile"."rqth_employee", + "users_jobseekerprofile"."oeth_employee", + "users_jobseekerprofile"."pole_emploi_since", + "users_jobseekerprofile"."unemployed_since", + "users_jobseekerprofile"."has_rsa_allocation", + "users_jobseekerprofile"."rsa_allocation_since", + "users_jobseekerprofile"."ass_allocation_since", + "users_jobseekerprofile"."aah_allocation_since", + "users_jobseekerprofile"."are_allocation_since", + "users_jobseekerprofile"."activity_bonus_since", + "users_jobseekerprofile"."cape_freelance", + "users_jobseekerprofile"."cesa_freelance", + "users_jobseekerprofile"."actor_met_for_business_creation", + "users_jobseekerprofile"."mean_monthly_income_before_process", + "users_jobseekerprofile"."eiti_contributions", + "users_jobseekerprofile"."hexa_lane_number", + "users_jobseekerprofile"."hexa_std_extension", + "users_jobseekerprofile"."hexa_non_std_extension", + "users_jobseekerprofile"."hexa_lane_type", + "users_jobseekerprofile"."hexa_lane_name", + "users_jobseekerprofile"."hexa_additional_address", + "users_jobseekerprofile"."hexa_post_code", + "users_jobseekerprofile"."hexa_commune_id", + "users_jobseekerprofile"."pe_obfuscated_nir", + "users_jobseekerprofile"."pe_last_certification_attempt_at" + FROM "users_user" + LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") + WHERE ("users_user"."kind" = %s + AND "users_user"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'User.is_prescriber_with_authorized_org[users/models.py]', + 'User.can_edit_personal_information[users/models.py]', + 'User.can_view_personal_information[users/models.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT %s AS "a" + FROM "prescribers_prescribermembership" + INNER JOIN "users_user" ON ("prescribers_prescribermembership"."user_id" = "users_user"."id") + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active" + AND "prescribers_prescriberorganization"."is_authorized" + AND "users_user"."is_active") + LIMIT 1 + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + ]), + }) +# --- +# name: TestUpdateJobSeekerForHire.test_as_company_with_proxied_job_seeker[queries - start] + dict({ + 'num_queries': 11, + 'queries': list([ + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE "users_user"."id" = %s + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "companies_companymembership"."id", + "companies_companymembership"."user_id", + "companies_companymembership"."joined_at", + "companies_companymembership"."is_admin", + "companies_companymembership"."is_active", + "companies_companymembership"."created_at", + "companies_companymembership"."updated_at", + "companies_companymembership"."company_id", + "companies_companymembership"."updated_by_id", + "companies_companymembership"."notifications" + FROM "companies_companymembership" + WHERE ("companies_companymembership"."user_id" = %s + AND "companies_companymembership"."is_active") + ORDER BY "companies_companymembership"."created_at" ASC + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."deactivated_at" >= %s + AND U0."id" = ("companies_company"."convention_id")) + LIMIT 1) AS "has_convention_in_grace_period", + "companies_siaeconvention"."id", + "companies_siaeconvention"."kind", + "companies_siaeconvention"."siret_signature", + "companies_siaeconvention"."is_active", + "companies_siaeconvention"."deactivated_at", + "companies_siaeconvention"."reactivated_by_id", + "companies_siaeconvention"."reactivated_at", + "companies_siaeconvention"."asp_id", + "companies_siaeconvention"."created_at", + "companies_siaeconvention"."updated_at" + FROM "companies_company" + INNER JOIN "companies_companymembership" ON ("companies_company"."id" = "companies_companymembership"."company_id") + LEFT OUTER JOIN "companies_siaeconvention" ON ("companies_company"."convention_id" = "companies_siaeconvention"."id") + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_companymembership"."user_id" = %s + AND "companies_company"."id" IN (%s) + AND (NOT ("companies_company"."kind" IN (%s, + %s, + %s, + %s, + %s)) + OR "companies_company"."source" = %s + OR EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."id" = ("companies_company"."convention_id") + AND U0."is_active") + LIMIT 1) + OR EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."deactivated_at" >= %s + AND U0."id" = ("companies_company"."convention_id")) + LIMIT 1))) + ORDER BY RANDOM() ASC + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStartView.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" FROM "users_user" - LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") WHERE ("users_user"."kind" = %s AND "users_user"."public_id" = %s) LIMIT 21 @@ -1715,30 +9756,7 @@ }), dict({ 'origin': list([ - 'User.is_prescriber_with_authorized_org[users/models.py]', - 'User.can_edit_personal_information[users/models.py]', - 'User.can_view_personal_information[users/models.py]', - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT %s AS "a" - FROM "prescribers_prescribermembership" - INNER JOIN "users_user" ON ("prescribers_prescribermembership"."user_id" = "users_user"."id") - INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") - WHERE ("prescribers_prescribermembership"."user_id" = %s - AND "prescribers_prescribermembership"."is_active" - AND "prescribers_prescriberorganization"."is_authorized" - AND "users_user"."is_active") - LIMIT 1 - ''', - }), - dict({ - 'origin': list([ - 'UpdateJobSeekerStep3View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep3View.setup[utils/session.py]', - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStartView.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT "companies_company"."id", @@ -1794,12 +9812,38 @@ ]), 'sql': 'RELEASE SAVEPOINT ""', }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'Session.save[/django/db/models/base.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + UPDATE "django_session" + SET "session_data" = %s, + "expire_date" = %s + WHERE "django_session"."session_key" = %s + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), ]), }) # --- -# name: TestUpdateJobSeeker.test_as_company_with_proxied_job_seeker[queries - step 1] +# name: TestUpdateJobSeekerForHire.test_as_company_with_proxied_job_seeker[queries - step 1] dict({ - 'num_queries': 13, + 'num_queries': 14, 'queries': list([ dict({ 'origin': list([ @@ -1815,6 +9859,20 @@ LIMIT 21 ''', }), + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), dict({ 'origin': list([ 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', @@ -1967,6 +10025,60 @@ ]), 'sql': 'SAVEPOINT ""', }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), dict({ 'origin': list([ 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', @@ -2044,62 +10156,7 @@ FROM "users_user" LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") WHERE ("users_user"."kind" = %s - AND "users_user"."public_id" = %s) - LIMIT 21 - ''', - }), - dict({ - 'origin': list([ - 'UpdateJobSeekerStep1View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep1View.setup[utils/session.py]', - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT "companies_company"."id", - "companies_company"."address_line_1", - "companies_company"."address_line_2", - "companies_company"."post_code", - "companies_company"."city", - "companies_company"."department", - "companies_company"."coords", - "companies_company"."geocoding_score", - "companies_company"."geocoding_updated_at", - "companies_company"."ban_api_resolved_address", - "companies_company"."insee_city_id", - "companies_company"."name", - "companies_company"."created_at", - "companies_company"."updated_at", - "companies_company"."uid", - "companies_company"."active_members_email_reminder_last_sent_at", - "companies_company"."automatic_geocoding_update", - "companies_company"."siret", - "companies_company"."naf", - "companies_company"."kind", - "companies_company"."brand", - "companies_company"."phone", - "companies_company"."email", - "companies_company"."auth_email", - "companies_company"."website", - "companies_company"."description", - "companies_company"."provided_support", - "companies_company"."source", - "companies_company"."created_by_id", - "companies_company"."block_job_applications", - "companies_company"."job_applications_blocked_at", - "companies_company"."convention_id", - "companies_company"."job_app_score", - "companies_company"."is_searchable", - "companies_company"."rdv_solidarites_id", - EXISTS - (SELECT %s AS "a" - FROM "companies_companymembership" U0 - WHERE (U0."company_id" = ("companies_company"."id") - AND U0."is_active") - LIMIT 1) AS "has_active_members" - FROM "companies_company" - WHERE (NOT ("companies_company"."siret" = %s) - AND "companies_company"."id" = %s) + AND "users_user"."id" = %s) LIMIT 21 ''', }), @@ -2186,9 +10243,9 @@ ]), }) # --- -# name: TestUpdateJobSeeker.test_as_company_with_proxied_job_seeker[queries - step 2] +# name: TestUpdateJobSeekerForHire.test_as_company_with_proxied_job_seeker[queries - step 2] dict({ - 'num_queries': 9, + 'num_queries': 10, 'queries': list([ dict({ 'origin': list([ @@ -2204,6 +10261,20 @@ LIMIT 21 ''', }), + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), dict({ 'origin': list([ 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', @@ -2360,51 +10431,6 @@ 'origin': list([ 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT "users_user"."id", - "users_user"."password", - "users_user"."last_login", - "users_user"."is_superuser", - "users_user"."username", - "users_user"."first_name", - "users_user"."last_name", - "users_user"."is_staff", - "users_user"."is_active", - "users_user"."date_joined", - "users_user"."address_line_1", - "users_user"."address_line_2", - "users_user"."post_code", - "users_user"."city", - "users_user"."department", - "users_user"."coords", - "users_user"."geocoding_score", - "users_user"."geocoding_updated_at", - "users_user"."ban_api_resolved_address", - "users_user"."insee_city_id", - "users_user"."title", - "users_user"."email", - "users_user"."phone", - "users_user"."kind", - "users_user"."identity_provider", - "users_user"."has_completed_welcoming_tour", - "users_user"."created_by_id", - "users_user"."external_data_source_history", - "users_user"."last_checked_at", - "users_user"."public_id", - "users_user"."address_filled_at", - "users_user"."first_login" - FROM "users_user" - WHERE ("users_user"."kind" = %s - AND "users_user"."public_id" = %s) - LIMIT 21 - ''', - }), - dict({ - 'origin': list([ - 'UpdateJobSeekerStep2View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep2View.setup[utils/session.py]', - 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' @@ -2455,6 +10481,50 @@ LIMIT 21 ''', }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE ("users_user"."kind" = %s + AND "users_user"."id" = %s) + LIMIT 21 + ''', + }), dict({ 'origin': list([ 'Atomic.__exit__[/django/db/transaction.py]', @@ -2492,9 +10562,9 @@ ]), }) # --- -# name: TestUpdateJobSeeker.test_as_company_with_proxied_job_seeker[queries - step 3] +# name: TestUpdateJobSeekerForHire.test_as_company_with_proxied_job_seeker[queries - step 3] dict({ - 'num_queries': 9, + 'num_queries': 10, 'queries': list([ dict({ 'origin': list([ @@ -2510,6 +10580,20 @@ LIMIT 21 ''', }), + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), dict({ 'origin': list([ 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', @@ -2662,6 +10746,60 @@ ]), 'sql': 'SAVEPOINT ""', }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), dict({ 'origin': list([ 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', @@ -2739,62 +10877,7 @@ FROM "users_user" LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") WHERE ("users_user"."kind" = %s - AND "users_user"."public_id" = %s) - LIMIT 21 - ''', - }), - dict({ - 'origin': list([ - 'UpdateJobSeekerStep3View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep3View.setup[utils/session.py]', - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT "companies_company"."id", - "companies_company"."address_line_1", - "companies_company"."address_line_2", - "companies_company"."post_code", - "companies_company"."city", - "companies_company"."department", - "companies_company"."coords", - "companies_company"."geocoding_score", - "companies_company"."geocoding_updated_at", - "companies_company"."ban_api_resolved_address", - "companies_company"."insee_city_id", - "companies_company"."name", - "companies_company"."created_at", - "companies_company"."updated_at", - "companies_company"."uid", - "companies_company"."active_members_email_reminder_last_sent_at", - "companies_company"."automatic_geocoding_update", - "companies_company"."siret", - "companies_company"."naf", - "companies_company"."kind", - "companies_company"."brand", - "companies_company"."phone", - "companies_company"."email", - "companies_company"."auth_email", - "companies_company"."website", - "companies_company"."description", - "companies_company"."provided_support", - "companies_company"."source", - "companies_company"."created_by_id", - "companies_company"."block_job_applications", - "companies_company"."job_applications_blocked_at", - "companies_company"."convention_id", - "companies_company"."job_app_score", - "companies_company"."is_searchable", - "companies_company"."rdv_solidarites_id", - EXISTS - (SELECT %s AS "a" - FROM "companies_companymembership" U0 - WHERE (U0."company_id" = ("companies_company"."id") - AND U0."is_active") - LIMIT 1) AS "has_active_members" - FROM "companies_company" - WHERE (NOT ("companies_company"."siret" = %s) - AND "companies_company"."id" = %s) + AND "users_user"."id" = %s) LIMIT 21 ''', }), @@ -2835,9 +10918,9 @@ ]), }) # --- -# name: TestUpdateJobSeeker.test_as_unauthorized_prescriber_that_created_proxied_job_seeker[queries - step 1] +# name: TestUpdateJobSeekerForHire.test_as_company_with_proxied_job_seeker_deprecated[queries - step 2] dict({ - 'num_queries': 12, + 'num_queries': 10, 'queries': list([ dict({ 'origin': list([ @@ -2900,51 +10983,103 @@ 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', ]), 'sql': ''' - SELECT "prescribers_prescribermembership"."id", - "prescribers_prescribermembership"."user_id", - "prescribers_prescribermembership"."joined_at", - "prescribers_prescribermembership"."is_admin", - "prescribers_prescribermembership"."is_active", - "prescribers_prescribermembership"."created_at", - "prescribers_prescribermembership"."updated_at", - "prescribers_prescribermembership"."organization_id", - "prescribers_prescribermembership"."updated_by_id", - "prescribers_prescriberorganization"."id", - "prescribers_prescriberorganization"."address_line_1", - "prescribers_prescriberorganization"."address_line_2", - "prescribers_prescriberorganization"."post_code", - "prescribers_prescriberorganization"."city", - "prescribers_prescriberorganization"."department", - "prescribers_prescriberorganization"."coords", - "prescribers_prescriberorganization"."geocoding_score", - "prescribers_prescriberorganization"."geocoding_updated_at", - "prescribers_prescriberorganization"."ban_api_resolved_address", - "prescribers_prescriberorganization"."insee_city_id", - "prescribers_prescriberorganization"."name", - "prescribers_prescriberorganization"."created_at", - "prescribers_prescriberorganization"."updated_at", - "prescribers_prescriberorganization"."uid", - "prescribers_prescriberorganization"."active_members_email_reminder_last_sent_at", - "prescribers_prescriberorganization"."automatic_geocoding_update", - "prescribers_prescriberorganization"."siret", - "prescribers_prescriberorganization"."is_head_office", - "prescribers_prescriberorganization"."kind", - "prescribers_prescriberorganization"."is_brsa", - "prescribers_prescriberorganization"."phone", - "prescribers_prescriberorganization"."email", - "prescribers_prescriberorganization"."website", - "prescribers_prescriberorganization"."description", - "prescribers_prescriberorganization"."is_authorized", - "prescribers_prescriberorganization"."code_safir_pole_emploi", - "prescribers_prescriberorganization"."created_by_id", - "prescribers_prescriberorganization"."authorization_status", - "prescribers_prescriberorganization"."authorization_updated_at", - "prescribers_prescriberorganization"."authorization_updated_by_id" - FROM "prescribers_prescribermembership" - INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") - WHERE ("prescribers_prescribermembership"."user_id" = %s - AND "prescribers_prescribermembership"."is_active") - ORDER BY "prescribers_prescribermembership"."created_at" ASC + SELECT "companies_companymembership"."id", + "companies_companymembership"."user_id", + "companies_companymembership"."joined_at", + "companies_companymembership"."is_admin", + "companies_companymembership"."is_active", + "companies_companymembership"."created_at", + "companies_companymembership"."updated_at", + "companies_companymembership"."company_id", + "companies_companymembership"."updated_by_id", + "companies_companymembership"."notifications" + FROM "companies_companymembership" + WHERE ("companies_companymembership"."user_id" = %s + AND "companies_companymembership"."is_active") + ORDER BY "companies_companymembership"."created_at" ASC + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."deactivated_at" >= %s + AND U0."id" = ("companies_company"."convention_id")) + LIMIT 1) AS "has_convention_in_grace_period", + "companies_siaeconvention"."id", + "companies_siaeconvention"."kind", + "companies_siaeconvention"."siret_signature", + "companies_siaeconvention"."is_active", + "companies_siaeconvention"."deactivated_at", + "companies_siaeconvention"."reactivated_by_id", + "companies_siaeconvention"."reactivated_at", + "companies_siaeconvention"."asp_id", + "companies_siaeconvention"."created_at", + "companies_siaeconvention"."updated_at" + FROM "companies_company" + INNER JOIN "companies_companymembership" ON ("companies_company"."id" = "companies_companymembership"."company_id") + LEFT OUTER JOIN "companies_siaeconvention" ON ("companies_company"."convention_id" = "companies_siaeconvention"."id") + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_companymembership"."user_id" = %s + AND "companies_company"."id" IN (%s) + AND (NOT ("companies_company"."kind" IN (%s, + %s, + %s, + %s, + %s)) + OR "companies_company"."source" = %s + OR EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."id" = ("companies_company"."convention_id") + AND U0."is_active") + LIMIT 1) + OR EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."deactivated_at" >= %s + AND U0."id" = ("companies_company"."convention_id")) + LIMIT 1))) + ORDER BY RANDOM() ASC ''', }), dict({ @@ -2955,8 +11090,8 @@ }), dict({ 'origin': list([ - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT "users_user"."id", @@ -2990,45 +11125,8 @@ "users_user"."last_checked_at", "users_user"."public_id", "users_user"."address_filled_at", - "users_user"."first_login", - "users_jobseekerprofile"."user_id", - "users_jobseekerprofile"."birthdate", - "users_jobseekerprofile"."birth_place_id", - "users_jobseekerprofile"."birth_country_id", - "users_jobseekerprofile"."nir", - "users_jobseekerprofile"."lack_of_nir_reason", - "users_jobseekerprofile"."pole_emploi_id", - "users_jobseekerprofile"."lack_of_pole_emploi_id_reason", - "users_jobseekerprofile"."asp_uid", - "users_jobseekerprofile"."education_level", - "users_jobseekerprofile"."resourceless", - "users_jobseekerprofile"."rqth_employee", - "users_jobseekerprofile"."oeth_employee", - "users_jobseekerprofile"."pole_emploi_since", - "users_jobseekerprofile"."unemployed_since", - "users_jobseekerprofile"."has_rsa_allocation", - "users_jobseekerprofile"."rsa_allocation_since", - "users_jobseekerprofile"."ass_allocation_since", - "users_jobseekerprofile"."aah_allocation_since", - "users_jobseekerprofile"."are_allocation_since", - "users_jobseekerprofile"."activity_bonus_since", - "users_jobseekerprofile"."cape_freelance", - "users_jobseekerprofile"."cesa_freelance", - "users_jobseekerprofile"."actor_met_for_business_creation", - "users_jobseekerprofile"."mean_monthly_income_before_process", - "users_jobseekerprofile"."eiti_contributions", - "users_jobseekerprofile"."hexa_lane_number", - "users_jobseekerprofile"."hexa_std_extension", - "users_jobseekerprofile"."hexa_non_std_extension", - "users_jobseekerprofile"."hexa_lane_type", - "users_jobseekerprofile"."hexa_lane_name", - "users_jobseekerprofile"."hexa_additional_address", - "users_jobseekerprofile"."hexa_post_code", - "users_jobseekerprofile"."hexa_commune_id", - "users_jobseekerprofile"."pe_obfuscated_nir", - "users_jobseekerprofile"."pe_last_certification_attempt_at" + "users_user"."first_login" FROM "users_user" - LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") WHERE ("users_user"."kind" = %s AND "users_user"."public_id" = %s) LIMIT 21 @@ -3036,30 +11134,10 @@ }), dict({ 'origin': list([ - 'User.is_prescriber_with_authorized_org[users/models.py]', - 'User.can_edit_personal_information[users/models.py]', - 'User.can_view_personal_information[users/models.py]', - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT %s AS "a" - FROM "prescribers_prescribermembership" - INNER JOIN "users_user" ON ("prescribers_prescribermembership"."user_id" = "users_user"."id") - INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") - WHERE ("prescribers_prescribermembership"."user_id" = %s - AND "prescribers_prescribermembership"."is_active" - AND "prescribers_prescriberorganization"."is_authorized" - AND "users_user"."is_active") - LIMIT 1 - ''', - }), - dict({ - 'origin': list([ - 'UpdateJobSeekerStep1View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep1View.setup[utils/session.py]', - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep2View.setup[www/apply/views/submit_views.py]', + 'DeprecatedUpdateJobSeekerStep2View.setup[utils/session.py]', + 'DeprecatedUpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT "companies_company"."id", @@ -3111,62 +11189,64 @@ }), dict({ 'origin': list([ - 'Atomic.__exit__[/django/db/transaction.py]', - ]), - 'sql': 'RELEASE SAVEPOINT ""', - }), - dict({ - 'origin': list([ - 'CustomFieldRenderer.render[utils/custom_renderer.py]', - 'SimpleNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', - 'IfNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', - 'BlockNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', - 'BlockNode[layout/base.html]', - 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', - 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', + 'Company.has_member[common_apps/organizations/models.py]', + 'DeprecatedUpdateJobSeekerStep2View.dispatch[www/apply/views/submit_views.py]', ]), 'sql': ''' - SELECT "asp_country"."id", - "asp_country"."code", - "asp_country"."name", - "asp_country"."group", - "asp_country"."department" - FROM "asp_country" - ORDER BY "asp_country"."name" ASC + SELECT %s AS "a" + FROM "users_user" + INNER JOIN "companies_companymembership" ON ("users_user"."id" = "companies_companymembership"."user_id") + WHERE ("companies_companymembership"."id" IN + (SELECT U0."id" + FROM "companies_companymembership" U0 + INNER JOIN "users_user" U2 ON (U0."user_id" = U2."id") + WHERE (U0."company_id" = %s + AND U2."is_active" + AND U0."is_active")) + AND "users_user"."id" = %s) + LIMIT 1 ''', }), dict({ 'origin': list([ - 'Atomic.__enter__[/django/db/transaction.py]', - 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + 'Atomic.__exit__[/django/db/transaction.py]', ]), - 'sql': 'SAVEPOINT ""', + 'sql': 'RELEASE SAVEPOINT ""', }), dict({ 'origin': list([ - 'Session.save[/django/db/models/base.py]', - 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + 'Company.has_admin[common_apps/organizations/models.py]', + 'Company.convention_can_be_accessed_by[companies/models.py]', + 'nav[utils/templatetags/nav.py]', + 'InclusionNode[layout/_header_authenticated.html]', + 'IncludeNode[layout/base.html]', + 'IfNode[layout/base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_2.html]', ]), 'sql': ''' - UPDATE "django_session" - SET "session_data" = %s, - "expire_date" = %s - WHERE "django_session"."session_key" = %s + SELECT %s AS "a" + FROM "users_user" + INNER JOIN "companies_companymembership" ON ("users_user"."id" = "companies_companymembership"."user_id") + WHERE ("companies_companymembership"."id" IN + (SELECT U0."id" + FROM "companies_companymembership" U0 + INNER JOIN "users_user" U2 ON (U0."user_id" = U2."id") + WHERE (U0."company_id" = %s + AND U2."is_active" + AND U0."is_active" + AND U0."is_admin" + AND U2."is_active")) + AND "users_user"."id" = %s) + LIMIT 1 ''', }), - dict({ - 'origin': list([ - 'Atomic.__exit__[/django/db/transaction.py]', - 'SessionStore.save[/django/contrib/sessions/backends/db.py]', - ]), - 'sql': 'RELEASE SAVEPOINT ""', - }), ]), }) # --- -# name: TestUpdateJobSeeker.test_as_unauthorized_prescriber_that_created_proxied_job_seeker[queries - step 2] +# name: TestUpdateJobSeekerForHire.test_as_company_with_proxied_job_seeker_deprecated[queries - step 3] dict({ - 'num_queries': 8, + 'num_queries': 10, 'queries': list([ dict({ 'origin': list([ @@ -3229,51 +11309,103 @@ 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', ]), 'sql': ''' - SELECT "prescribers_prescribermembership"."id", - "prescribers_prescribermembership"."user_id", - "prescribers_prescribermembership"."joined_at", - "prescribers_prescribermembership"."is_admin", - "prescribers_prescribermembership"."is_active", - "prescribers_prescribermembership"."created_at", - "prescribers_prescribermembership"."updated_at", - "prescribers_prescribermembership"."organization_id", - "prescribers_prescribermembership"."updated_by_id", - "prescribers_prescriberorganization"."id", - "prescribers_prescriberorganization"."address_line_1", - "prescribers_prescriberorganization"."address_line_2", - "prescribers_prescriberorganization"."post_code", - "prescribers_prescriberorganization"."city", - "prescribers_prescriberorganization"."department", - "prescribers_prescriberorganization"."coords", - "prescribers_prescriberorganization"."geocoding_score", - "prescribers_prescriberorganization"."geocoding_updated_at", - "prescribers_prescriberorganization"."ban_api_resolved_address", - "prescribers_prescriberorganization"."insee_city_id", - "prescribers_prescriberorganization"."name", - "prescribers_prescriberorganization"."created_at", - "prescribers_prescriberorganization"."updated_at", - "prescribers_prescriberorganization"."uid", - "prescribers_prescriberorganization"."active_members_email_reminder_last_sent_at", - "prescribers_prescriberorganization"."automatic_geocoding_update", - "prescribers_prescriberorganization"."siret", - "prescribers_prescriberorganization"."is_head_office", - "prescribers_prescriberorganization"."kind", - "prescribers_prescriberorganization"."is_brsa", - "prescribers_prescriberorganization"."phone", - "prescribers_prescriberorganization"."email", - "prescribers_prescriberorganization"."website", - "prescribers_prescriberorganization"."description", - "prescribers_prescriberorganization"."is_authorized", - "prescribers_prescriberorganization"."code_safir_pole_emploi", - "prescribers_prescriberorganization"."created_by_id", - "prescribers_prescriberorganization"."authorization_status", - "prescribers_prescriberorganization"."authorization_updated_at", - "prescribers_prescriberorganization"."authorization_updated_by_id" - FROM "prescribers_prescribermembership" - INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") - WHERE ("prescribers_prescribermembership"."user_id" = %s - AND "prescribers_prescribermembership"."is_active") - ORDER BY "prescribers_prescribermembership"."created_at" ASC + SELECT "companies_companymembership"."id", + "companies_companymembership"."user_id", + "companies_companymembership"."joined_at", + "companies_companymembership"."is_admin", + "companies_companymembership"."is_active", + "companies_companymembership"."created_at", + "companies_companymembership"."updated_at", + "companies_companymembership"."company_id", + "companies_companymembership"."updated_by_id", + "companies_companymembership"."notifications" + FROM "companies_companymembership" + WHERE ("companies_companymembership"."user_id" = %s + AND "companies_companymembership"."is_active") + ORDER BY "companies_companymembership"."created_at" ASC + ''', + }), + dict({ + 'origin': list([ + 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."deactivated_at" >= %s + AND U0."id" = ("companies_company"."convention_id")) + LIMIT 1) AS "has_convention_in_grace_period", + "companies_siaeconvention"."id", + "companies_siaeconvention"."kind", + "companies_siaeconvention"."siret_signature", + "companies_siaeconvention"."is_active", + "companies_siaeconvention"."deactivated_at", + "companies_siaeconvention"."reactivated_by_id", + "companies_siaeconvention"."reactivated_at", + "companies_siaeconvention"."asp_id", + "companies_siaeconvention"."created_at", + "companies_siaeconvention"."updated_at" + FROM "companies_company" + INNER JOIN "companies_companymembership" ON ("companies_company"."id" = "companies_companymembership"."company_id") + LEFT OUTER JOIN "companies_siaeconvention" ON ("companies_company"."convention_id" = "companies_siaeconvention"."id") + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_companymembership"."user_id" = %s + AND "companies_company"."id" IN (%s) + AND (NOT ("companies_company"."kind" IN (%s, + %s, + %s, + %s, + %s)) + OR "companies_company"."source" = %s + OR EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."id" = ("companies_company"."convention_id") + AND U0."is_active") + LIMIT 1) + OR EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."deactivated_at" >= %s + AND U0."id" = ("companies_company"."convention_id")) + LIMIT 1))) + ORDER BY RANDOM() ASC ''', }), dict({ @@ -3284,8 +11416,8 @@ }), dict({ 'origin': list([ - 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT "users_user"."id", @@ -3319,8 +11451,45 @@ "users_user"."last_checked_at", "users_user"."public_id", "users_user"."address_filled_at", - "users_user"."first_login" + "users_user"."first_login", + "users_jobseekerprofile"."user_id", + "users_jobseekerprofile"."birthdate", + "users_jobseekerprofile"."birth_place_id", + "users_jobseekerprofile"."birth_country_id", + "users_jobseekerprofile"."nir", + "users_jobseekerprofile"."lack_of_nir_reason", + "users_jobseekerprofile"."pole_emploi_id", + "users_jobseekerprofile"."lack_of_pole_emploi_id_reason", + "users_jobseekerprofile"."asp_uid", + "users_jobseekerprofile"."education_level", + "users_jobseekerprofile"."resourceless", + "users_jobseekerprofile"."rqth_employee", + "users_jobseekerprofile"."oeth_employee", + "users_jobseekerprofile"."pole_emploi_since", + "users_jobseekerprofile"."unemployed_since", + "users_jobseekerprofile"."has_rsa_allocation", + "users_jobseekerprofile"."rsa_allocation_since", + "users_jobseekerprofile"."ass_allocation_since", + "users_jobseekerprofile"."aah_allocation_since", + "users_jobseekerprofile"."are_allocation_since", + "users_jobseekerprofile"."activity_bonus_since", + "users_jobseekerprofile"."cape_freelance", + "users_jobseekerprofile"."cesa_freelance", + "users_jobseekerprofile"."actor_met_for_business_creation", + "users_jobseekerprofile"."mean_monthly_income_before_process", + "users_jobseekerprofile"."eiti_contributions", + "users_jobseekerprofile"."hexa_lane_number", + "users_jobseekerprofile"."hexa_std_extension", + "users_jobseekerprofile"."hexa_non_std_extension", + "users_jobseekerprofile"."hexa_lane_type", + "users_jobseekerprofile"."hexa_lane_name", + "users_jobseekerprofile"."hexa_additional_address", + "users_jobseekerprofile"."hexa_post_code", + "users_jobseekerprofile"."hexa_commune_id", + "users_jobseekerprofile"."pe_obfuscated_nir", + "users_jobseekerprofile"."pe_last_certification_attempt_at" FROM "users_user" + LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") WHERE ("users_user"."kind" = %s AND "users_user"."public_id" = %s) LIMIT 21 @@ -3328,30 +11497,10 @@ }), dict({ 'origin': list([ - 'User.is_prescriber_with_authorized_org[users/models.py]', - 'User.can_edit_personal_information[users/models.py]', - 'User.can_view_personal_information[users/models.py]', - 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT %s AS "a" - FROM "prescribers_prescribermembership" - INNER JOIN "users_user" ON ("prescribers_prescribermembership"."user_id" = "users_user"."id") - INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") - WHERE ("prescribers_prescribermembership"."user_id" = %s - AND "prescribers_prescribermembership"."is_active" - AND "prescribers_prescriberorganization"."is_authorized" - AND "users_user"."is_active") - LIMIT 1 - ''', - }), - dict({ - 'origin': list([ - 'UpdateJobSeekerStep2View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep2View.setup[utils/session.py]', - 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep3View.setup[www/apply/views/submit_views.py]', + 'DeprecatedUpdateJobSeekerStep3View.setup[utils/session.py]', + 'DeprecatedUpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT "companies_company"."id", @@ -3401,18 +11550,66 @@ LIMIT 21 ''', }), + dict({ + 'origin': list([ + 'Company.has_member[common_apps/organizations/models.py]', + 'DeprecatedUpdateJobSeekerStep3View.dispatch[www/apply/views/submit_views.py]', + ]), + 'sql': ''' + SELECT %s AS "a" + FROM "users_user" + INNER JOIN "companies_companymembership" ON ("users_user"."id" = "companies_companymembership"."user_id") + WHERE ("companies_companymembership"."id" IN + (SELECT U0."id" + FROM "companies_companymembership" U0 + INNER JOIN "users_user" U2 ON (U0."user_id" = U2."id") + WHERE (U0."company_id" = %s + AND U2."is_active" + AND U0."is_active")) + AND "users_user"."id" = %s) + LIMIT 1 + ''', + }), dict({ 'origin': list([ 'Atomic.__exit__[/django/db/transaction.py]', ]), 'sql': 'RELEASE SAVEPOINT ""', }), + dict({ + 'origin': list([ + 'Company.has_admin[common_apps/organizations/models.py]', + 'Company.convention_can_be_accessed_by[companies/models.py]', + 'nav[utils/templatetags/nav.py]', + 'InclusionNode[layout/_header_authenticated.html]', + 'IncludeNode[layout/base.html]', + 'IfNode[layout/base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_3.html]', + ]), + 'sql': ''' + SELECT %s AS "a" + FROM "users_user" + INNER JOIN "companies_companymembership" ON ("users_user"."id" = "companies_companymembership"."user_id") + WHERE ("companies_companymembership"."id" IN + (SELECT U0."id" + FROM "companies_companymembership" U0 + INNER JOIN "users_user" U2 ON (U0."user_id" = U2."id") + WHERE (U0."company_id" = %s + AND U2."is_active" + AND U0."is_active" + AND U0."is_admin" + AND U2."is_active")) + AND "users_user"."id" = %s) + LIMIT 1 + ''', + }), ]), }) # --- -# name: TestUpdateJobSeeker.test_as_unauthorized_prescriber_that_created_proxied_job_seeker[queries - step 3] +# name: TestUpdateJobSeekerForHire.test_as_unauthorized_prescriber_that_created_proxied_job_seeker[queries - start] dict({ - 'num_queries': 8, + 'num_queries': 11, 'queries': list([ dict({ 'origin': list([ @@ -3530,8 +11727,7 @@ }), dict({ 'origin': list([ - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStartView.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT "users_user"."id", @@ -3565,76 +11761,16 @@ "users_user"."last_checked_at", "users_user"."public_id", "users_user"."address_filled_at", - "users_user"."first_login", - "users_jobseekerprofile"."user_id", - "users_jobseekerprofile"."birthdate", - "users_jobseekerprofile"."birth_place_id", - "users_jobseekerprofile"."birth_country_id", - "users_jobseekerprofile"."nir", - "users_jobseekerprofile"."lack_of_nir_reason", - "users_jobseekerprofile"."pole_emploi_id", - "users_jobseekerprofile"."lack_of_pole_emploi_id_reason", - "users_jobseekerprofile"."asp_uid", - "users_jobseekerprofile"."education_level", - "users_jobseekerprofile"."resourceless", - "users_jobseekerprofile"."rqth_employee", - "users_jobseekerprofile"."oeth_employee", - "users_jobseekerprofile"."pole_emploi_since", - "users_jobseekerprofile"."unemployed_since", - "users_jobseekerprofile"."has_rsa_allocation", - "users_jobseekerprofile"."rsa_allocation_since", - "users_jobseekerprofile"."ass_allocation_since", - "users_jobseekerprofile"."aah_allocation_since", - "users_jobseekerprofile"."are_allocation_since", - "users_jobseekerprofile"."activity_bonus_since", - "users_jobseekerprofile"."cape_freelance", - "users_jobseekerprofile"."cesa_freelance", - "users_jobseekerprofile"."actor_met_for_business_creation", - "users_jobseekerprofile"."mean_monthly_income_before_process", - "users_jobseekerprofile"."eiti_contributions", - "users_jobseekerprofile"."hexa_lane_number", - "users_jobseekerprofile"."hexa_std_extension", - "users_jobseekerprofile"."hexa_non_std_extension", - "users_jobseekerprofile"."hexa_lane_type", - "users_jobseekerprofile"."hexa_lane_name", - "users_jobseekerprofile"."hexa_additional_address", - "users_jobseekerprofile"."hexa_post_code", - "users_jobseekerprofile"."hexa_commune_id", - "users_jobseekerprofile"."pe_obfuscated_nir", - "users_jobseekerprofile"."pe_last_certification_attempt_at" + "users_user"."first_login" FROM "users_user" - LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") WHERE ("users_user"."kind" = %s - AND "users_user"."public_id" = %s) - LIMIT 21 - ''', - }), - dict({ - 'origin': list([ - 'User.is_prescriber_with_authorized_org[users/models.py]', - 'User.can_edit_personal_information[users/models.py]', - 'User.can_view_personal_information[users/models.py]', - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT %s AS "a" - FROM "prescribers_prescribermembership" - INNER JOIN "users_user" ON ("prescribers_prescribermembership"."user_id" = "users_user"."id") - INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") - WHERE ("prescribers_prescribermembership"."user_id" = %s - AND "prescribers_prescribermembership"."is_active" - AND "prescribers_prescriberorganization"."is_authorized" - AND "users_user"."is_active") - LIMIT 1 + AND "users_user"."public_id" = %s) + LIMIT 21 ''', }), dict({ 'origin': list([ - 'UpdateJobSeekerStep3View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep3View.setup[utils/session.py]', - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStartView.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT "companies_company"."id", @@ -3684,16 +11820,61 @@ LIMIT 21 ''', }), + dict({ + 'origin': list([ + 'User.is_prescriber_with_authorized_org[users/models.py]', + 'User.can_edit_personal_information[users/models.py]', + 'User.can_view_personal_information[users/models.py]', + 'UpdateJobSeekerStartView.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT %s AS "a" + FROM "prescribers_prescribermembership" + INNER JOIN "users_user" ON ("prescribers_prescribermembership"."user_id" = "users_user"."id") + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active" + AND "prescribers_prescriberorganization"."is_authorized" + AND "users_user"."is_active") + LIMIT 1 + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'Session.save[/django/db/models/base.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + UPDATE "django_session" + SET "session_data" = %s, + "expire_date" = %s + WHERE "django_session"."session_key" = %s + ''', + }), dict({ 'origin': list([ 'Atomic.__exit__[/django/db/transaction.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', ]), 'sql': 'RELEASE SAVEPOINT ""', }), ]), }) # --- -# name: TestUpdateJobSeeker.test_with_job_seeker_without_nir[queries - step 1] +# name: TestUpdateJobSeekerForHire.test_as_unauthorized_prescriber_that_created_proxied_job_seeker[queries - step 1] dict({ 'num_queries': 13, 'queries': list([ @@ -3711,6 +11892,20 @@ LIMIT 21 ''', }), + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), dict({ 'origin': list([ 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', @@ -3758,25 +11953,64 @@ 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', ]), 'sql': ''' - SELECT "companies_companymembership"."id", - "companies_companymembership"."user_id", - "companies_companymembership"."joined_at", - "companies_companymembership"."is_admin", - "companies_companymembership"."is_active", - "companies_companymembership"."created_at", - "companies_companymembership"."updated_at", - "companies_companymembership"."company_id", - "companies_companymembership"."updated_by_id", - "companies_companymembership"."notifications" - FROM "companies_companymembership" - WHERE ("companies_companymembership"."user_id" = %s - AND "companies_companymembership"."is_active") - ORDER BY "companies_companymembership"."created_at" ASC + SELECT "prescribers_prescribermembership"."id", + "prescribers_prescribermembership"."user_id", + "prescribers_prescribermembership"."joined_at", + "prescribers_prescribermembership"."is_admin", + "prescribers_prescribermembership"."is_active", + "prescribers_prescribermembership"."created_at", + "prescribers_prescribermembership"."updated_at", + "prescribers_prescribermembership"."organization_id", + "prescribers_prescribermembership"."updated_by_id", + "prescribers_prescriberorganization"."id", + "prescribers_prescriberorganization"."address_line_1", + "prescribers_prescriberorganization"."address_line_2", + "prescribers_prescriberorganization"."post_code", + "prescribers_prescriberorganization"."city", + "prescribers_prescriberorganization"."department", + "prescribers_prescriberorganization"."coords", + "prescribers_prescriberorganization"."geocoding_score", + "prescribers_prescriberorganization"."geocoding_updated_at", + "prescribers_prescriberorganization"."ban_api_resolved_address", + "prescribers_prescriberorganization"."insee_city_id", + "prescribers_prescriberorganization"."name", + "prescribers_prescriberorganization"."created_at", + "prescribers_prescriberorganization"."updated_at", + "prescribers_prescriberorganization"."uid", + "prescribers_prescriberorganization"."active_members_email_reminder_last_sent_at", + "prescribers_prescriberorganization"."automatic_geocoding_update", + "prescribers_prescriberorganization"."siret", + "prescribers_prescriberorganization"."is_head_office", + "prescribers_prescriberorganization"."kind", + "prescribers_prescriberorganization"."is_brsa", + "prescribers_prescriberorganization"."phone", + "prescribers_prescriberorganization"."email", + "prescribers_prescriberorganization"."website", + "prescribers_prescriberorganization"."description", + "prescribers_prescriberorganization"."is_authorized", + "prescribers_prescriberorganization"."code_safir_pole_emploi", + "prescribers_prescriberorganization"."created_by_id", + "prescribers_prescriberorganization"."authorization_status", + "prescribers_prescriberorganization"."authorization_updated_at", + "prescribers_prescriberorganization"."authorization_updated_by_id" + FROM "prescribers_prescribermembership" + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active") + ORDER BY "prescribers_prescribermembership"."created_at" ASC ''', }), dict({ 'origin': list([ - 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + 'Atomic.__enter__[/django/db/transaction.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT "companies_company"."id", @@ -3816,53 +12050,16 @@ "companies_company"."rdv_solidarites_id", EXISTS (SELECT %s AS "a" - FROM "companies_siaeconvention" U0 - WHERE (U0."deactivated_at" >= %s - AND U0."id" = ("companies_company"."convention_id")) - LIMIT 1) AS "has_convention_in_grace_period", - "companies_siaeconvention"."id", - "companies_siaeconvention"."kind", - "companies_siaeconvention"."siret_signature", - "companies_siaeconvention"."is_active", - "companies_siaeconvention"."deactivated_at", - "companies_siaeconvention"."reactivated_by_id", - "companies_siaeconvention"."reactivated_at", - "companies_siaeconvention"."asp_id", - "companies_siaeconvention"."created_at", - "companies_siaeconvention"."updated_at" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" FROM "companies_company" - INNER JOIN "companies_companymembership" ON ("companies_company"."id" = "companies_companymembership"."company_id") - LEFT OUTER JOIN "companies_siaeconvention" ON ("companies_company"."convention_id" = "companies_siaeconvention"."id") WHERE (NOT ("companies_company"."siret" = %s) - AND "companies_companymembership"."user_id" = %s - AND "companies_company"."id" IN (%s) - AND (NOT ("companies_company"."kind" IN (%s, - %s, - %s, - %s, - %s)) - OR "companies_company"."source" = %s - OR EXISTS - (SELECT %s AS "a" - FROM "companies_siaeconvention" U0 - WHERE (U0."id" = ("companies_company"."convention_id") - AND U0."is_active") - LIMIT 1) - OR EXISTS - (SELECT %s AS "a" - FROM "companies_siaeconvention" U0 - WHERE (U0."deactivated_at" >= %s - AND U0."id" = ("companies_company"."convention_id")) - LIMIT 1))) - ORDER BY RANDOM() ASC + AND "companies_company"."id" = %s) + LIMIT 21 ''', }), - dict({ - 'origin': list([ - 'Atomic.__enter__[/django/db/transaction.py]', - ]), - 'sql': 'SAVEPOINT ""', - }), dict({ 'origin': list([ 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', @@ -3919,120 +12116,57 @@ "users_jobseekerprofile"."has_rsa_allocation", "users_jobseekerprofile"."rsa_allocation_since", "users_jobseekerprofile"."ass_allocation_since", - "users_jobseekerprofile"."aah_allocation_since", - "users_jobseekerprofile"."are_allocation_since", - "users_jobseekerprofile"."activity_bonus_since", - "users_jobseekerprofile"."cape_freelance", - "users_jobseekerprofile"."cesa_freelance", - "users_jobseekerprofile"."actor_met_for_business_creation", - "users_jobseekerprofile"."mean_monthly_income_before_process", - "users_jobseekerprofile"."eiti_contributions", - "users_jobseekerprofile"."hexa_lane_number", - "users_jobseekerprofile"."hexa_std_extension", - "users_jobseekerprofile"."hexa_non_std_extension", - "users_jobseekerprofile"."hexa_lane_type", - "users_jobseekerprofile"."hexa_lane_name", - "users_jobseekerprofile"."hexa_additional_address", - "users_jobseekerprofile"."hexa_post_code", - "users_jobseekerprofile"."hexa_commune_id", - "users_jobseekerprofile"."pe_obfuscated_nir", - "users_jobseekerprofile"."pe_last_certification_attempt_at" - FROM "users_user" - LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") - WHERE ("users_user"."kind" = %s - AND "users_user"."public_id" = %s) - LIMIT 21 - ''', - }), - dict({ - 'origin': list([ - 'UpdateJobSeekerStep1View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep1View.setup[utils/session.py]', - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT "companies_company"."id", - "companies_company"."address_line_1", - "companies_company"."address_line_2", - "companies_company"."post_code", - "companies_company"."city", - "companies_company"."department", - "companies_company"."coords", - "companies_company"."geocoding_score", - "companies_company"."geocoding_updated_at", - "companies_company"."ban_api_resolved_address", - "companies_company"."insee_city_id", - "companies_company"."name", - "companies_company"."created_at", - "companies_company"."updated_at", - "companies_company"."uid", - "companies_company"."active_members_email_reminder_last_sent_at", - "companies_company"."automatic_geocoding_update", - "companies_company"."siret", - "companies_company"."naf", - "companies_company"."kind", - "companies_company"."brand", - "companies_company"."phone", - "companies_company"."email", - "companies_company"."auth_email", - "companies_company"."website", - "companies_company"."description", - "companies_company"."provided_support", - "companies_company"."source", - "companies_company"."created_by_id", - "companies_company"."block_job_applications", - "companies_company"."job_applications_blocked_at", - "companies_company"."convention_id", - "companies_company"."job_app_score", - "companies_company"."is_searchable", - "companies_company"."rdv_solidarites_id", - EXISTS - (SELECT %s AS "a" - FROM "companies_companymembership" U0 - WHERE (U0."company_id" = ("companies_company"."id") - AND U0."is_active") - LIMIT 1) AS "has_active_members" - FROM "companies_company" - WHERE (NOT ("companies_company"."siret" = %s) - AND "companies_company"."id" = %s) + "users_jobseekerprofile"."aah_allocation_since", + "users_jobseekerprofile"."are_allocation_since", + "users_jobseekerprofile"."activity_bonus_since", + "users_jobseekerprofile"."cape_freelance", + "users_jobseekerprofile"."cesa_freelance", + "users_jobseekerprofile"."actor_met_for_business_creation", + "users_jobseekerprofile"."mean_monthly_income_before_process", + "users_jobseekerprofile"."eiti_contributions", + "users_jobseekerprofile"."hexa_lane_number", + "users_jobseekerprofile"."hexa_std_extension", + "users_jobseekerprofile"."hexa_non_std_extension", + "users_jobseekerprofile"."hexa_lane_type", + "users_jobseekerprofile"."hexa_lane_name", + "users_jobseekerprofile"."hexa_additional_address", + "users_jobseekerprofile"."hexa_post_code", + "users_jobseekerprofile"."hexa_commune_id", + "users_jobseekerprofile"."pe_obfuscated_nir", + "users_jobseekerprofile"."pe_last_certification_attempt_at" + FROM "users_user" + LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") + WHERE ("users_user"."kind" = %s + AND "users_user"."id" = %s) LIMIT 21 ''', }), dict({ 'origin': list([ - 'Atomic.__exit__[/django/db/transaction.py]', - ]), - 'sql': 'RELEASE SAVEPOINT ""', - }), - dict({ - 'origin': list([ - 'Company.has_admin[common_apps/organizations/models.py]', - 'Company.convention_can_be_accessed_by[companies/models.py]', - 'nav[utils/templatetags/nav.py]', - 'InclusionNode[layout/_header_authenticated.html]', - 'IncludeNode[layout/base.html]', - 'IfNode[layout/base.html]', - 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', - 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', + 'User.is_prescriber_with_authorized_org[users/models.py]', + 'User.can_edit_personal_information[users/models.py]', + 'User.can_view_personal_information[users/models.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT %s AS "a" - FROM "users_user" - INNER JOIN "companies_companymembership" ON ("users_user"."id" = "companies_companymembership"."user_id") - WHERE ("companies_companymembership"."id" IN - (SELECT U0."id" - FROM "companies_companymembership" U0 - INNER JOIN "users_user" U2 ON (U0."user_id" = U2."id") - WHERE (U0."company_id" = %s - AND U2."is_active" - AND U0."is_active" - AND U0."is_admin" - AND U2."is_active")) - AND "users_user"."id" = %s) + FROM "prescribers_prescribermembership" + INNER JOIN "users_user" ON ("prescribers_prescribermembership"."user_id" = "users_user"."id") + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active" + AND "prescribers_prescriberorganization"."is_authorized" + AND "users_user"."is_active") LIMIT 1 ''', }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), dict({ 'origin': list([ 'CustomFieldRenderer.render[utils/custom_renderer.py]', @@ -4082,7 +12216,7 @@ ]), }) # --- -# name: TestUpdateJobSeeker.test_with_job_seeker_without_nir[queries - step 2] +# name: TestUpdateJobSeekerForHire.test_as_unauthorized_prescriber_that_created_proxied_job_seeker[queries - step 2] dict({ 'num_queries': 9, 'queries': list([ @@ -4100,6 +12234,20 @@ LIMIT 21 ''', }), + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), dict({ 'origin': list([ 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', @@ -4147,25 +12295,64 @@ 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', ]), 'sql': ''' - SELECT "companies_companymembership"."id", - "companies_companymembership"."user_id", - "companies_companymembership"."joined_at", - "companies_companymembership"."is_admin", - "companies_companymembership"."is_active", - "companies_companymembership"."created_at", - "companies_companymembership"."updated_at", - "companies_companymembership"."company_id", - "companies_companymembership"."updated_by_id", - "companies_companymembership"."notifications" - FROM "companies_companymembership" - WHERE ("companies_companymembership"."user_id" = %s - AND "companies_companymembership"."is_active") - ORDER BY "companies_companymembership"."created_at" ASC + SELECT "prescribers_prescribermembership"."id", + "prescribers_prescribermembership"."user_id", + "prescribers_prescribermembership"."joined_at", + "prescribers_prescribermembership"."is_admin", + "prescribers_prescribermembership"."is_active", + "prescribers_prescribermembership"."created_at", + "prescribers_prescribermembership"."updated_at", + "prescribers_prescribermembership"."organization_id", + "prescribers_prescribermembership"."updated_by_id", + "prescribers_prescriberorganization"."id", + "prescribers_prescriberorganization"."address_line_1", + "prescribers_prescriberorganization"."address_line_2", + "prescribers_prescriberorganization"."post_code", + "prescribers_prescriberorganization"."city", + "prescribers_prescriberorganization"."department", + "prescribers_prescriberorganization"."coords", + "prescribers_prescriberorganization"."geocoding_score", + "prescribers_prescriberorganization"."geocoding_updated_at", + "prescribers_prescriberorganization"."ban_api_resolved_address", + "prescribers_prescriberorganization"."insee_city_id", + "prescribers_prescriberorganization"."name", + "prescribers_prescriberorganization"."created_at", + "prescribers_prescriberorganization"."updated_at", + "prescribers_prescriberorganization"."uid", + "prescribers_prescriberorganization"."active_members_email_reminder_last_sent_at", + "prescribers_prescriberorganization"."automatic_geocoding_update", + "prescribers_prescriberorganization"."siret", + "prescribers_prescriberorganization"."is_head_office", + "prescribers_prescriberorganization"."kind", + "prescribers_prescriberorganization"."is_brsa", + "prescribers_prescriberorganization"."phone", + "prescribers_prescriberorganization"."email", + "prescribers_prescriberorganization"."website", + "prescribers_prescriberorganization"."description", + "prescribers_prescriberorganization"."is_authorized", + "prescribers_prescriberorganization"."code_safir_pole_emploi", + "prescribers_prescriberorganization"."created_by_id", + "prescribers_prescriberorganization"."authorization_status", + "prescribers_prescriberorganization"."authorization_updated_at", + "prescribers_prescriberorganization"."authorization_updated_by_id" + FROM "prescribers_prescribermembership" + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active") + ORDER BY "prescribers_prescribermembership"."created_at" ASC ''', }), dict({ 'origin': list([ - 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + 'Atomic.__enter__[/django/db/transaction.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT "companies_company"."id", @@ -4205,53 +12392,16 @@ "companies_company"."rdv_solidarites_id", EXISTS (SELECT %s AS "a" - FROM "companies_siaeconvention" U0 - WHERE (U0."deactivated_at" >= %s - AND U0."id" = ("companies_company"."convention_id")) - LIMIT 1) AS "has_convention_in_grace_period", - "companies_siaeconvention"."id", - "companies_siaeconvention"."kind", - "companies_siaeconvention"."siret_signature", - "companies_siaeconvention"."is_active", - "companies_siaeconvention"."deactivated_at", - "companies_siaeconvention"."reactivated_by_id", - "companies_siaeconvention"."reactivated_at", - "companies_siaeconvention"."asp_id", - "companies_siaeconvention"."created_at", - "companies_siaeconvention"."updated_at" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" FROM "companies_company" - INNER JOIN "companies_companymembership" ON ("companies_company"."id" = "companies_companymembership"."company_id") - LEFT OUTER JOIN "companies_siaeconvention" ON ("companies_company"."convention_id" = "companies_siaeconvention"."id") WHERE (NOT ("companies_company"."siret" = %s) - AND "companies_companymembership"."user_id" = %s - AND "companies_company"."id" IN (%s) - AND (NOT ("companies_company"."kind" IN (%s, - %s, - %s, - %s, - %s)) - OR "companies_company"."source" = %s - OR EXISTS - (SELECT %s AS "a" - FROM "companies_siaeconvention" U0 - WHERE (U0."id" = ("companies_company"."convention_id") - AND U0."is_active") - LIMIT 1) - OR EXISTS - (SELECT %s AS "a" - FROM "companies_siaeconvention" U0 - WHERE (U0."deactivated_at" >= %s - AND U0."id" = ("companies_company"."convention_id")) - LIMIT 1))) - ORDER BY RANDOM() ASC + AND "companies_company"."id" = %s) + LIMIT 21 ''', }), - dict({ - 'origin': list([ - 'Atomic.__enter__[/django/db/transaction.py]', - ]), - 'sql': 'SAVEPOINT ""', - }), dict({ 'origin': list([ 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', @@ -4289,106 +12439,43 @@ "users_user"."last_checked_at", "users_user"."public_id", "users_user"."address_filled_at", - "users_user"."first_login" - FROM "users_user" - WHERE ("users_user"."kind" = %s - AND "users_user"."public_id" = %s) - LIMIT 21 - ''', - }), - dict({ - 'origin': list([ - 'UpdateJobSeekerStep2View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep2View.setup[utils/session.py]', - 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT "companies_company"."id", - "companies_company"."address_line_1", - "companies_company"."address_line_2", - "companies_company"."post_code", - "companies_company"."city", - "companies_company"."department", - "companies_company"."coords", - "companies_company"."geocoding_score", - "companies_company"."geocoding_updated_at", - "companies_company"."ban_api_resolved_address", - "companies_company"."insee_city_id", - "companies_company"."name", - "companies_company"."created_at", - "companies_company"."updated_at", - "companies_company"."uid", - "companies_company"."active_members_email_reminder_last_sent_at", - "companies_company"."automatic_geocoding_update", - "companies_company"."siret", - "companies_company"."naf", - "companies_company"."kind", - "companies_company"."brand", - "companies_company"."phone", - "companies_company"."email", - "companies_company"."auth_email", - "companies_company"."website", - "companies_company"."description", - "companies_company"."provided_support", - "companies_company"."source", - "companies_company"."created_by_id", - "companies_company"."block_job_applications", - "companies_company"."job_applications_blocked_at", - "companies_company"."convention_id", - "companies_company"."job_app_score", - "companies_company"."is_searchable", - "companies_company"."rdv_solidarites_id", - EXISTS - (SELECT %s AS "a" - FROM "companies_companymembership" U0 - WHERE (U0."company_id" = ("companies_company"."id") - AND U0."is_active") - LIMIT 1) AS "has_active_members" - FROM "companies_company" - WHERE (NOT ("companies_company"."siret" = %s) - AND "companies_company"."id" = %s) + "users_user"."first_login" + FROM "users_user" + WHERE ("users_user"."kind" = %s + AND "users_user"."id" = %s) LIMIT 21 ''', }), dict({ 'origin': list([ - 'Atomic.__exit__[/django/db/transaction.py]', - ]), - 'sql': 'RELEASE SAVEPOINT ""', - }), - dict({ - 'origin': list([ - 'Company.has_admin[common_apps/organizations/models.py]', - 'Company.convention_can_be_accessed_by[companies/models.py]', - 'nav[utils/templatetags/nav.py]', - 'InclusionNode[layout/_header_authenticated.html]', - 'IncludeNode[layout/base.html]', - 'IfNode[layout/base.html]', - 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', - 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_2.html]', + 'User.is_prescriber_with_authorized_org[users/models.py]', + 'User.can_edit_personal_information[users/models.py]', + 'User.can_view_personal_information[users/models.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT %s AS "a" - FROM "users_user" - INNER JOIN "companies_companymembership" ON ("users_user"."id" = "companies_companymembership"."user_id") - WHERE ("companies_companymembership"."id" IN - (SELECT U0."id" - FROM "companies_companymembership" U0 - INNER JOIN "users_user" U2 ON (U0."user_id" = U2."id") - WHERE (U0."company_id" = %s - AND U2."is_active" - AND U0."is_active" - AND U0."is_admin" - AND U2."is_active")) - AND "users_user"."id" = %s) + FROM "prescribers_prescribermembership" + INNER JOIN "users_user" ON ("prescribers_prescribermembership"."user_id" = "users_user"."id") + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active" + AND "prescribers_prescriberorganization"."is_authorized" + AND "users_user"."is_active") LIMIT 1 ''', }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), ]), }) # --- -# name: TestUpdateJobSeeker.test_with_job_seeker_without_nir[queries - step 3] +# name: TestUpdateJobSeekerForHire.test_as_unauthorized_prescriber_that_created_proxied_job_seeker[queries - step 3] dict({ 'num_queries': 9, 'queries': list([ @@ -4406,6 +12493,20 @@ LIMIT 21 ''', }), + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), dict({ 'origin': list([ 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', @@ -4453,25 +12554,64 @@ 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', ]), 'sql': ''' - SELECT "companies_companymembership"."id", - "companies_companymembership"."user_id", - "companies_companymembership"."joined_at", - "companies_companymembership"."is_admin", - "companies_companymembership"."is_active", - "companies_companymembership"."created_at", - "companies_companymembership"."updated_at", - "companies_companymembership"."company_id", - "companies_companymembership"."updated_by_id", - "companies_companymembership"."notifications" - FROM "companies_companymembership" - WHERE ("companies_companymembership"."user_id" = %s - AND "companies_companymembership"."is_active") - ORDER BY "companies_companymembership"."created_at" ASC + SELECT "prescribers_prescribermembership"."id", + "prescribers_prescribermembership"."user_id", + "prescribers_prescribermembership"."joined_at", + "prescribers_prescribermembership"."is_admin", + "prescribers_prescribermembership"."is_active", + "prescribers_prescribermembership"."created_at", + "prescribers_prescribermembership"."updated_at", + "prescribers_prescribermembership"."organization_id", + "prescribers_prescribermembership"."updated_by_id", + "prescribers_prescriberorganization"."id", + "prescribers_prescriberorganization"."address_line_1", + "prescribers_prescriberorganization"."address_line_2", + "prescribers_prescriberorganization"."post_code", + "prescribers_prescriberorganization"."city", + "prescribers_prescriberorganization"."department", + "prescribers_prescriberorganization"."coords", + "prescribers_prescriberorganization"."geocoding_score", + "prescribers_prescriberorganization"."geocoding_updated_at", + "prescribers_prescriberorganization"."ban_api_resolved_address", + "prescribers_prescriberorganization"."insee_city_id", + "prescribers_prescriberorganization"."name", + "prescribers_prescriberorganization"."created_at", + "prescribers_prescriberorganization"."updated_at", + "prescribers_prescriberorganization"."uid", + "prescribers_prescriberorganization"."active_members_email_reminder_last_sent_at", + "prescribers_prescriberorganization"."automatic_geocoding_update", + "prescribers_prescriberorganization"."siret", + "prescribers_prescriberorganization"."is_head_office", + "prescribers_prescriberorganization"."kind", + "prescribers_prescriberorganization"."is_brsa", + "prescribers_prescriberorganization"."phone", + "prescribers_prescriberorganization"."email", + "prescribers_prescriberorganization"."website", + "prescribers_prescriberorganization"."description", + "prescribers_prescriberorganization"."is_authorized", + "prescribers_prescriberorganization"."code_safir_pole_emploi", + "prescribers_prescriberorganization"."created_by_id", + "prescribers_prescriberorganization"."authorization_status", + "prescribers_prescriberorganization"."authorization_updated_at", + "prescribers_prescriberorganization"."authorization_updated_by_id" + FROM "prescribers_prescribermembership" + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active") + ORDER BY "prescribers_prescribermembership"."created_at" ASC ''', }), dict({ 'origin': list([ - 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', + 'Atomic.__enter__[/django/db/transaction.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT "companies_company"."id", @@ -4511,53 +12651,16 @@ "companies_company"."rdv_solidarites_id", EXISTS (SELECT %s AS "a" - FROM "companies_siaeconvention" U0 - WHERE (U0."deactivated_at" >= %s - AND U0."id" = ("companies_company"."convention_id")) - LIMIT 1) AS "has_convention_in_grace_period", - "companies_siaeconvention"."id", - "companies_siaeconvention"."kind", - "companies_siaeconvention"."siret_signature", - "companies_siaeconvention"."is_active", - "companies_siaeconvention"."deactivated_at", - "companies_siaeconvention"."reactivated_by_id", - "companies_siaeconvention"."reactivated_at", - "companies_siaeconvention"."asp_id", - "companies_siaeconvention"."created_at", - "companies_siaeconvention"."updated_at" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" FROM "companies_company" - INNER JOIN "companies_companymembership" ON ("companies_company"."id" = "companies_companymembership"."company_id") - LEFT OUTER JOIN "companies_siaeconvention" ON ("companies_company"."convention_id" = "companies_siaeconvention"."id") WHERE (NOT ("companies_company"."siret" = %s) - AND "companies_companymembership"."user_id" = %s - AND "companies_company"."id" IN (%s) - AND (NOT ("companies_company"."kind" IN (%s, - %s, - %s, - %s, - %s)) - OR "companies_company"."source" = %s - OR EXISTS - (SELECT %s AS "a" - FROM "companies_siaeconvention" U0 - WHERE (U0."id" = ("companies_company"."convention_id") - AND U0."is_active") - LIMIT 1) - OR EXISTS - (SELECT %s AS "a" - FROM "companies_siaeconvention" U0 - WHERE (U0."deactivated_at" >= %s - AND U0."id" = ("companies_company"."convention_id")) - LIMIT 1))) - ORDER BY RANDOM() ASC + AND "companies_company"."id" = %s) + LIMIT 21 ''', }), - dict({ - 'origin': list([ - 'Atomic.__enter__[/django/db/transaction.py]', - ]), - 'sql': 'SAVEPOINT ""', - }), dict({ 'origin': list([ 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', @@ -4614,126 +12717,63 @@ "users_jobseekerprofile"."has_rsa_allocation", "users_jobseekerprofile"."rsa_allocation_since", "users_jobseekerprofile"."ass_allocation_since", - "users_jobseekerprofile"."aah_allocation_since", - "users_jobseekerprofile"."are_allocation_since", - "users_jobseekerprofile"."activity_bonus_since", - "users_jobseekerprofile"."cape_freelance", - "users_jobseekerprofile"."cesa_freelance", - "users_jobseekerprofile"."actor_met_for_business_creation", - "users_jobseekerprofile"."mean_monthly_income_before_process", - "users_jobseekerprofile"."eiti_contributions", - "users_jobseekerprofile"."hexa_lane_number", - "users_jobseekerprofile"."hexa_std_extension", - "users_jobseekerprofile"."hexa_non_std_extension", - "users_jobseekerprofile"."hexa_lane_type", - "users_jobseekerprofile"."hexa_lane_name", - "users_jobseekerprofile"."hexa_additional_address", - "users_jobseekerprofile"."hexa_post_code", - "users_jobseekerprofile"."hexa_commune_id", - "users_jobseekerprofile"."pe_obfuscated_nir", - "users_jobseekerprofile"."pe_last_certification_attempt_at" - FROM "users_user" - LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") - WHERE ("users_user"."kind" = %s - AND "users_user"."public_id" = %s) - LIMIT 21 - ''', - }), - dict({ - 'origin': list([ - 'UpdateJobSeekerStep3View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep3View.setup[utils/session.py]', - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT "companies_company"."id", - "companies_company"."address_line_1", - "companies_company"."address_line_2", - "companies_company"."post_code", - "companies_company"."city", - "companies_company"."department", - "companies_company"."coords", - "companies_company"."geocoding_score", - "companies_company"."geocoding_updated_at", - "companies_company"."ban_api_resolved_address", - "companies_company"."insee_city_id", - "companies_company"."name", - "companies_company"."created_at", - "companies_company"."updated_at", - "companies_company"."uid", - "companies_company"."active_members_email_reminder_last_sent_at", - "companies_company"."automatic_geocoding_update", - "companies_company"."siret", - "companies_company"."naf", - "companies_company"."kind", - "companies_company"."brand", - "companies_company"."phone", - "companies_company"."email", - "companies_company"."auth_email", - "companies_company"."website", - "companies_company"."description", - "companies_company"."provided_support", - "companies_company"."source", - "companies_company"."created_by_id", - "companies_company"."block_job_applications", - "companies_company"."job_applications_blocked_at", - "companies_company"."convention_id", - "companies_company"."job_app_score", - "companies_company"."is_searchable", - "companies_company"."rdv_solidarites_id", - EXISTS - (SELECT %s AS "a" - FROM "companies_companymembership" U0 - WHERE (U0."company_id" = ("companies_company"."id") - AND U0."is_active") - LIMIT 1) AS "has_active_members" - FROM "companies_company" - WHERE (NOT ("companies_company"."siret" = %s) - AND "companies_company"."id" = %s) + "users_jobseekerprofile"."aah_allocation_since", + "users_jobseekerprofile"."are_allocation_since", + "users_jobseekerprofile"."activity_bonus_since", + "users_jobseekerprofile"."cape_freelance", + "users_jobseekerprofile"."cesa_freelance", + "users_jobseekerprofile"."actor_met_for_business_creation", + "users_jobseekerprofile"."mean_monthly_income_before_process", + "users_jobseekerprofile"."eiti_contributions", + "users_jobseekerprofile"."hexa_lane_number", + "users_jobseekerprofile"."hexa_std_extension", + "users_jobseekerprofile"."hexa_non_std_extension", + "users_jobseekerprofile"."hexa_lane_type", + "users_jobseekerprofile"."hexa_lane_name", + "users_jobseekerprofile"."hexa_additional_address", + "users_jobseekerprofile"."hexa_post_code", + "users_jobseekerprofile"."hexa_commune_id", + "users_jobseekerprofile"."pe_obfuscated_nir", + "users_jobseekerprofile"."pe_last_certification_attempt_at" + FROM "users_user" + LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") + WHERE ("users_user"."kind" = %s + AND "users_user"."id" = %s) LIMIT 21 ''', }), dict({ 'origin': list([ - 'Atomic.__exit__[/django/db/transaction.py]', - ]), - 'sql': 'RELEASE SAVEPOINT ""', - }), - dict({ - 'origin': list([ - 'Company.has_admin[common_apps/organizations/models.py]', - 'Company.convention_can_be_accessed_by[companies/models.py]', - 'nav[utils/templatetags/nav.py]', - 'InclusionNode[layout/_header_authenticated.html]', - 'IncludeNode[layout/base.html]', - 'IfNode[layout/base.html]', - 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', - 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_3.html]', + 'User.is_prescriber_with_authorized_org[users/models.py]', + 'User.can_edit_personal_information[users/models.py]', + 'User.can_view_personal_information[users/models.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT %s AS "a" - FROM "users_user" - INNER JOIN "companies_companymembership" ON ("users_user"."id" = "companies_companymembership"."user_id") - WHERE ("companies_companymembership"."id" IN - (SELECT U0."id" - FROM "companies_companymembership" U0 - INNER JOIN "users_user" U2 ON (U0."user_id" = U2."id") - WHERE (U0."company_id" = %s - AND U2."is_active" - AND U0."is_active" - AND U0."is_admin" - AND U2."is_active")) - AND "users_user"."id" = %s) + FROM "prescribers_prescribermembership" + INNER JOIN "users_user" ON ("prescribers_prescribermembership"."user_id" = "users_user"."id") + INNER JOIN "prescribers_prescriberorganization" ON ("prescribers_prescribermembership"."organization_id" = "prescribers_prescriberorganization"."id") + WHERE ("prescribers_prescribermembership"."user_id" = %s + AND "prescribers_prescribermembership"."is_active" + AND "prescribers_prescriberorganization"."is_authorized" + AND "users_user"."is_active") LIMIT 1 ''', }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), ]), }) # --- -# name: TestUpdateJobSeekerForHire.test_as_company_with_proxied_job_seeker[queries - step 1] +# name: TestUpdateJobSeekerForHire.test_with_job_seeker_without_nir[queries - start] dict({ - 'num_queries': 14, + 'num_queries': 11, 'queries': list([ dict({ 'origin': list([ @@ -4903,8 +12943,7 @@ }), dict({ 'origin': list([ - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStartView.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT "users_user"."id", @@ -4938,45 +12977,8 @@ "users_user"."last_checked_at", "users_user"."public_id", "users_user"."address_filled_at", - "users_user"."first_login", - "users_jobseekerprofile"."user_id", - "users_jobseekerprofile"."birthdate", - "users_jobseekerprofile"."birth_place_id", - "users_jobseekerprofile"."birth_country_id", - "users_jobseekerprofile"."nir", - "users_jobseekerprofile"."lack_of_nir_reason", - "users_jobseekerprofile"."pole_emploi_id", - "users_jobseekerprofile"."lack_of_pole_emploi_id_reason", - "users_jobseekerprofile"."asp_uid", - "users_jobseekerprofile"."education_level", - "users_jobseekerprofile"."resourceless", - "users_jobseekerprofile"."rqth_employee", - "users_jobseekerprofile"."oeth_employee", - "users_jobseekerprofile"."pole_emploi_since", - "users_jobseekerprofile"."unemployed_since", - "users_jobseekerprofile"."has_rsa_allocation", - "users_jobseekerprofile"."rsa_allocation_since", - "users_jobseekerprofile"."ass_allocation_since", - "users_jobseekerprofile"."aah_allocation_since", - "users_jobseekerprofile"."are_allocation_since", - "users_jobseekerprofile"."activity_bonus_since", - "users_jobseekerprofile"."cape_freelance", - "users_jobseekerprofile"."cesa_freelance", - "users_jobseekerprofile"."actor_met_for_business_creation", - "users_jobseekerprofile"."mean_monthly_income_before_process", - "users_jobseekerprofile"."eiti_contributions", - "users_jobseekerprofile"."hexa_lane_number", - "users_jobseekerprofile"."hexa_std_extension", - "users_jobseekerprofile"."hexa_non_std_extension", - "users_jobseekerprofile"."hexa_lane_type", - "users_jobseekerprofile"."hexa_lane_name", - "users_jobseekerprofile"."hexa_additional_address", - "users_jobseekerprofile"."hexa_post_code", - "users_jobseekerprofile"."hexa_commune_id", - "users_jobseekerprofile"."pe_obfuscated_nir", - "users_jobseekerprofile"."pe_last_certification_attempt_at" + "users_user"."first_login" FROM "users_user" - LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") WHERE ("users_user"."kind" = %s AND "users_user"."public_id" = %s) LIMIT 21 @@ -4984,10 +12986,7 @@ }), dict({ 'origin': list([ - 'UpdateJobSeekerStep1View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep1View.setup[utils/session.py]', - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStartView.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT "companies_company"."id", @@ -5037,80 +13036,12 @@ LIMIT 21 ''', }), - dict({ - 'origin': list([ - 'Company.has_member[common_apps/organizations/models.py]', - 'UpdateJobSeekerStep1View.dispatch[www/apply/views/submit_views.py]', - ]), - 'sql': ''' - SELECT %s AS "a" - FROM "users_user" - INNER JOIN "companies_companymembership" ON ("users_user"."id" = "companies_companymembership"."user_id") - WHERE ("companies_companymembership"."id" IN - (SELECT U0."id" - FROM "companies_companymembership" U0 - INNER JOIN "users_user" U2 ON (U0."user_id" = U2."id") - WHERE (U0."company_id" = %s - AND U2."is_active" - AND U0."is_active")) - AND "users_user"."id" = %s) - LIMIT 1 - ''', - }), dict({ 'origin': list([ 'Atomic.__exit__[/django/db/transaction.py]', ]), 'sql': 'RELEASE SAVEPOINT ""', }), - dict({ - 'origin': list([ - 'Company.has_admin[common_apps/organizations/models.py]', - 'Company.convention_can_be_accessed_by[companies/models.py]', - 'nav[utils/templatetags/nav.py]', - 'InclusionNode[layout/_header_authenticated.html]', - 'IncludeNode[layout/base.html]', - 'IfNode[layout/base.html]', - 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', - 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', - ]), - 'sql': ''' - SELECT %s AS "a" - FROM "users_user" - INNER JOIN "companies_companymembership" ON ("users_user"."id" = "companies_companymembership"."user_id") - WHERE ("companies_companymembership"."id" IN - (SELECT U0."id" - FROM "companies_companymembership" U0 - INNER JOIN "users_user" U2 ON (U0."user_id" = U2."id") - WHERE (U0."company_id" = %s - AND U2."is_active" - AND U0."is_active" - AND U0."is_admin" - AND U2."is_active")) - AND "users_user"."id" = %s) - LIMIT 1 - ''', - }), - dict({ - 'origin': list([ - 'CustomFieldRenderer.render[utils/custom_renderer.py]', - 'SimpleNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', - 'IfNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', - 'BlockNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', - 'BlockNode[layout/base.html]', - 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', - 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', - ]), - 'sql': ''' - SELECT "asp_country"."id", - "asp_country"."code", - "asp_country"."name", - "asp_country"."group", - "asp_country"."department" - FROM "asp_country" - ORDER BY "asp_country"."name" ASC - ''', - }), dict({ 'origin': list([ 'Atomic.__enter__[/django/db/transaction.py]', @@ -5140,9 +13071,9 @@ ]), }) # --- -# name: TestUpdateJobSeekerForHire.test_as_company_with_proxied_job_seeker[queries - step 2] +# name: TestUpdateJobSeekerForHire.test_with_job_seeker_without_nir[queries - step 1] dict({ - 'num_queries': 10, + 'num_queries': 14, 'queries': list([ dict({ 'origin': list([ @@ -5158,6 +13089,20 @@ LIMIT 21 ''', }), + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), dict({ 'origin': list([ 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', @@ -5292,74 +13237,29 @@ OR EXISTS (SELECT %s AS "a" FROM "companies_siaeconvention" U0 - WHERE (U0."id" = ("companies_company"."convention_id") - AND U0."is_active") - LIMIT 1) - OR EXISTS - (SELECT %s AS "a" - FROM "companies_siaeconvention" U0 - WHERE (U0."deactivated_at" >= %s - AND U0."id" = ("companies_company"."convention_id")) - LIMIT 1))) - ORDER BY RANDOM() ASC - ''', - }), - dict({ - 'origin': list([ - 'Atomic.__enter__[/django/db/transaction.py]', - ]), - 'sql': 'SAVEPOINT ""', - }), - dict({ - 'origin': list([ - 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT "users_user"."id", - "users_user"."password", - "users_user"."last_login", - "users_user"."is_superuser", - "users_user"."username", - "users_user"."first_name", - "users_user"."last_name", - "users_user"."is_staff", - "users_user"."is_active", - "users_user"."date_joined", - "users_user"."address_line_1", - "users_user"."address_line_2", - "users_user"."post_code", - "users_user"."city", - "users_user"."department", - "users_user"."coords", - "users_user"."geocoding_score", - "users_user"."geocoding_updated_at", - "users_user"."ban_api_resolved_address", - "users_user"."insee_city_id", - "users_user"."title", - "users_user"."email", - "users_user"."phone", - "users_user"."kind", - "users_user"."identity_provider", - "users_user"."has_completed_welcoming_tour", - "users_user"."created_by_id", - "users_user"."external_data_source_history", - "users_user"."last_checked_at", - "users_user"."public_id", - "users_user"."address_filled_at", - "users_user"."first_login" - FROM "users_user" - WHERE ("users_user"."kind" = %s - AND "users_user"."public_id" = %s) - LIMIT 21 + WHERE (U0."id" = ("companies_company"."convention_id") + AND U0."is_active") + LIMIT 1) + OR EXISTS + (SELECT %s AS "a" + FROM "companies_siaeconvention" U0 + WHERE (U0."deactivated_at" >= %s + AND U0."id" = ("companies_company"."convention_id")) + LIMIT 1))) + ORDER BY RANDOM() ASC ''', }), dict({ 'origin': list([ - 'UpdateJobSeekerStep2View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep2View.setup[utils/session.py]', - 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'Atomic.__enter__[/django/db/transaction.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT "companies_company"."id", @@ -5411,22 +13311,83 @@ }), dict({ 'origin': list([ - 'Company.has_member[common_apps/organizations/models.py]', - 'UpdateJobSeekerStep2View.dispatch[www/apply/views/submit_views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' - SELECT %s AS "a" + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login", + "users_jobseekerprofile"."user_id", + "users_jobseekerprofile"."birthdate", + "users_jobseekerprofile"."birth_place_id", + "users_jobseekerprofile"."birth_country_id", + "users_jobseekerprofile"."nir", + "users_jobseekerprofile"."lack_of_nir_reason", + "users_jobseekerprofile"."pole_emploi_id", + "users_jobseekerprofile"."lack_of_pole_emploi_id_reason", + "users_jobseekerprofile"."asp_uid", + "users_jobseekerprofile"."education_level", + "users_jobseekerprofile"."resourceless", + "users_jobseekerprofile"."rqth_employee", + "users_jobseekerprofile"."oeth_employee", + "users_jobseekerprofile"."pole_emploi_since", + "users_jobseekerprofile"."unemployed_since", + "users_jobseekerprofile"."has_rsa_allocation", + "users_jobseekerprofile"."rsa_allocation_since", + "users_jobseekerprofile"."ass_allocation_since", + "users_jobseekerprofile"."aah_allocation_since", + "users_jobseekerprofile"."are_allocation_since", + "users_jobseekerprofile"."activity_bonus_since", + "users_jobseekerprofile"."cape_freelance", + "users_jobseekerprofile"."cesa_freelance", + "users_jobseekerprofile"."actor_met_for_business_creation", + "users_jobseekerprofile"."mean_monthly_income_before_process", + "users_jobseekerprofile"."eiti_contributions", + "users_jobseekerprofile"."hexa_lane_number", + "users_jobseekerprofile"."hexa_std_extension", + "users_jobseekerprofile"."hexa_non_std_extension", + "users_jobseekerprofile"."hexa_lane_type", + "users_jobseekerprofile"."hexa_lane_name", + "users_jobseekerprofile"."hexa_additional_address", + "users_jobseekerprofile"."hexa_post_code", + "users_jobseekerprofile"."hexa_commune_id", + "users_jobseekerprofile"."pe_obfuscated_nir", + "users_jobseekerprofile"."pe_last_certification_attempt_at" FROM "users_user" - INNER JOIN "companies_companymembership" ON ("users_user"."id" = "companies_companymembership"."user_id") - WHERE ("companies_companymembership"."id" IN - (SELECT U0."id" - FROM "companies_companymembership" U0 - INNER JOIN "users_user" U2 ON (U0."user_id" = U2."id") - WHERE (U0."company_id" = %s - AND U2."is_active" - AND U0."is_active")) + LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") + WHERE ("users_user"."kind" = %s AND "users_user"."id" = %s) - LIMIT 1 + LIMIT 21 ''', }), dict({ @@ -5444,7 +13405,7 @@ 'IncludeNode[layout/base.html]', 'IfNode[layout/base.html]', 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', - 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_2.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', ]), 'sql': ''' SELECT %s AS "a" @@ -5463,10 +13424,56 @@ LIMIT 1 ''', }), + dict({ + 'origin': list([ + 'CustomFieldRenderer.render[utils/custom_renderer.py]', + 'SimpleNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', + 'IfNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', + 'BlockNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', + 'BlockNode[layout/base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', + ]), + 'sql': ''' + SELECT "asp_country"."id", + "asp_country"."code", + "asp_country"."name", + "asp_country"."group", + "asp_country"."department" + FROM "asp_country" + ORDER BY "asp_country"."name" ASC + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'Session.save[/django/db/models/base.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + UPDATE "django_session" + SET "session_data" = %s, + "expire_date" = %s + WHERE "django_session"."session_key" = %s + ''', + }), + dict({ + 'origin': list([ + 'Atomic.__exit__[/django/db/transaction.py]', + 'SessionStore.save[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': 'RELEASE SAVEPOINT ""', + }), ]), }) # --- -# name: TestUpdateJobSeekerForHire.test_as_company_with_proxied_job_seeker[queries - step 3] +# name: TestUpdateJobSeekerForHire.test_with_job_seeker_without_nir[queries - step 2] dict({ 'num_queries': 10, 'queries': list([ @@ -5484,6 +13491,20 @@ LIMIT 21 ''', }), + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), dict({ 'origin': list([ 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', @@ -5638,91 +13659,9 @@ }), dict({ 'origin': list([ - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT "users_user"."id", - "users_user"."password", - "users_user"."last_login", - "users_user"."is_superuser", - "users_user"."username", - "users_user"."first_name", - "users_user"."last_name", - "users_user"."is_staff", - "users_user"."is_active", - "users_user"."date_joined", - "users_user"."address_line_1", - "users_user"."address_line_2", - "users_user"."post_code", - "users_user"."city", - "users_user"."department", - "users_user"."coords", - "users_user"."geocoding_score", - "users_user"."geocoding_updated_at", - "users_user"."ban_api_resolved_address", - "users_user"."insee_city_id", - "users_user"."title", - "users_user"."email", - "users_user"."phone", - "users_user"."kind", - "users_user"."identity_provider", - "users_user"."has_completed_welcoming_tour", - "users_user"."created_by_id", - "users_user"."external_data_source_history", - "users_user"."last_checked_at", - "users_user"."public_id", - "users_user"."address_filled_at", - "users_user"."first_login", - "users_jobseekerprofile"."user_id", - "users_jobseekerprofile"."birthdate", - "users_jobseekerprofile"."birth_place_id", - "users_jobseekerprofile"."birth_country_id", - "users_jobseekerprofile"."nir", - "users_jobseekerprofile"."lack_of_nir_reason", - "users_jobseekerprofile"."pole_emploi_id", - "users_jobseekerprofile"."lack_of_pole_emploi_id_reason", - "users_jobseekerprofile"."asp_uid", - "users_jobseekerprofile"."education_level", - "users_jobseekerprofile"."resourceless", - "users_jobseekerprofile"."rqth_employee", - "users_jobseekerprofile"."oeth_employee", - "users_jobseekerprofile"."pole_emploi_since", - "users_jobseekerprofile"."unemployed_since", - "users_jobseekerprofile"."has_rsa_allocation", - "users_jobseekerprofile"."rsa_allocation_since", - "users_jobseekerprofile"."ass_allocation_since", - "users_jobseekerprofile"."aah_allocation_since", - "users_jobseekerprofile"."are_allocation_since", - "users_jobseekerprofile"."activity_bonus_since", - "users_jobseekerprofile"."cape_freelance", - "users_jobseekerprofile"."cesa_freelance", - "users_jobseekerprofile"."actor_met_for_business_creation", - "users_jobseekerprofile"."mean_monthly_income_before_process", - "users_jobseekerprofile"."eiti_contributions", - "users_jobseekerprofile"."hexa_lane_number", - "users_jobseekerprofile"."hexa_std_extension", - "users_jobseekerprofile"."hexa_non_std_extension", - "users_jobseekerprofile"."hexa_lane_type", - "users_jobseekerprofile"."hexa_lane_name", - "users_jobseekerprofile"."hexa_additional_address", - "users_jobseekerprofile"."hexa_post_code", - "users_jobseekerprofile"."hexa_commune_id", - "users_jobseekerprofile"."pe_obfuscated_nir", - "users_jobseekerprofile"."pe_last_certification_attempt_at" - FROM "users_user" - LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") - WHERE ("users_user"."kind" = %s - AND "users_user"."public_id" = %s) - LIMIT 21 - ''', - }), - dict({ - 'origin': list([ - 'UpdateJobSeekerStep3View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep3View.setup[utils/session.py]', - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT "companies_company"."id", @@ -5774,22 +13713,46 @@ }), dict({ 'origin': list([ - 'Company.has_member[common_apps/organizations/models.py]', - 'UpdateJobSeekerStep3View.dispatch[www/apply/views/submit_views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' - SELECT %s AS "a" + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" FROM "users_user" - INNER JOIN "companies_companymembership" ON ("users_user"."id" = "companies_companymembership"."user_id") - WHERE ("companies_companymembership"."id" IN - (SELECT U0."id" - FROM "companies_companymembership" U0 - INNER JOIN "users_user" U2 ON (U0."user_id" = U2."id") - WHERE (U0."company_id" = %s - AND U2."is_active" - AND U0."is_active")) + WHERE ("users_user"."kind" = %s AND "users_user"."id" = %s) - LIMIT 1 + LIMIT 21 ''', }), dict({ @@ -5807,7 +13770,7 @@ 'IncludeNode[layout/base.html]', 'IfNode[layout/base.html]', 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', - 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_3.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_2.html]', ]), 'sql': ''' SELECT %s AS "a" @@ -5829,9 +13792,9 @@ ]), }) # --- -# name: TestUpdateJobSeekerForHire.test_with_job_seeker_without_nir[queries - step 1] +# name: TestUpdateJobSeekerForHire.test_with_job_seeker_without_nir[queries - step 3] dict({ - 'num_queries': 14, + 'num_queries': 10, 'queries': list([ dict({ 'origin': list([ @@ -5847,6 +13810,20 @@ LIMIT 21 ''', }), + dict({ + 'origin': list([ + 'SessionStore._get_session_from_db[/django/contrib/sessions/backends/db.py]', + ]), + 'sql': ''' + SELECT "django_session"."session_key", + "django_session"."session_data", + "django_session"."expire_date" + FROM "django_session" + WHERE ("django_session"."expire_date" > %s + AND "django_session"."session_key" = %s) + LIMIT 21 + ''', + }), dict({ 'origin': list([ 'ItouCurrentOrganizationMiddleware.__call__[utils/perms/middleware.py]', @@ -6001,8 +13978,62 @@ }), dict({ 'origin': list([ - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT "users_user"."id", @@ -6076,83 +14107,8 @@ FROM "users_user" LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") WHERE ("users_user"."kind" = %s - AND "users_user"."public_id" = %s) - LIMIT 21 - ''', - }), - dict({ - 'origin': list([ - 'UpdateJobSeekerStep1View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep1View.setup[utils/session.py]', - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT "companies_company"."id", - "companies_company"."address_line_1", - "companies_company"."address_line_2", - "companies_company"."post_code", - "companies_company"."city", - "companies_company"."department", - "companies_company"."coords", - "companies_company"."geocoding_score", - "companies_company"."geocoding_updated_at", - "companies_company"."ban_api_resolved_address", - "companies_company"."insee_city_id", - "companies_company"."name", - "companies_company"."created_at", - "companies_company"."updated_at", - "companies_company"."uid", - "companies_company"."active_members_email_reminder_last_sent_at", - "companies_company"."automatic_geocoding_update", - "companies_company"."siret", - "companies_company"."naf", - "companies_company"."kind", - "companies_company"."brand", - "companies_company"."phone", - "companies_company"."email", - "companies_company"."auth_email", - "companies_company"."website", - "companies_company"."description", - "companies_company"."provided_support", - "companies_company"."source", - "companies_company"."created_by_id", - "companies_company"."block_job_applications", - "companies_company"."job_applications_blocked_at", - "companies_company"."convention_id", - "companies_company"."job_app_score", - "companies_company"."is_searchable", - "companies_company"."rdv_solidarites_id", - EXISTS - (SELECT %s AS "a" - FROM "companies_companymembership" U0 - WHERE (U0."company_id" = ("companies_company"."id") - AND U0."is_active") - LIMIT 1) AS "has_active_members" - FROM "companies_company" - WHERE (NOT ("companies_company"."siret" = %s) - AND "companies_company"."id" = %s) - LIMIT 21 - ''', - }), - dict({ - 'origin': list([ - 'Company.has_member[common_apps/organizations/models.py]', - 'UpdateJobSeekerStep1View.dispatch[www/apply/views/submit_views.py]', - ]), - 'sql': ''' - SELECT %s AS "a" - FROM "users_user" - INNER JOIN "companies_companymembership" ON ("users_user"."id" = "companies_companymembership"."user_id") - WHERE ("companies_companymembership"."id" IN - (SELECT U0."id" - FROM "companies_companymembership" U0 - INNER JOIN "users_user" U2 ON (U0."user_id" = U2."id") - WHERE (U0."company_id" = %s - AND U2."is_active" - AND U0."is_active")) AND "users_user"."id" = %s) - LIMIT 1 + LIMIT 21 ''', }), dict({ @@ -6170,7 +14126,7 @@ 'IncludeNode[layout/base.html]', 'IfNode[layout/base.html]', 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', - 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', + 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_3.html]', ]), 'sql': ''' SELECT %s AS "a" @@ -6189,56 +14145,10 @@ LIMIT 1 ''', }), - dict({ - 'origin': list([ - 'CustomFieldRenderer.render[utils/custom_renderer.py]', - 'SimpleNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', - 'IfNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', - 'BlockNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', - 'BlockNode[layout/base.html]', - 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_base.html]', - 'ExtendsNode[job_seekers_views/create_or_update_job_seeker/step_1.html]', - ]), - 'sql': ''' - SELECT "asp_country"."id", - "asp_country"."code", - "asp_country"."name", - "asp_country"."group", - "asp_country"."department" - FROM "asp_country" - ORDER BY "asp_country"."name" ASC - ''', - }), - dict({ - 'origin': list([ - 'Atomic.__enter__[/django/db/transaction.py]', - 'SessionStore.save[/django/contrib/sessions/backends/db.py]', - ]), - 'sql': 'SAVEPOINT ""', - }), - dict({ - 'origin': list([ - 'Session.save[/django/db/models/base.py]', - 'SessionStore.save[/django/contrib/sessions/backends/db.py]', - ]), - 'sql': ''' - UPDATE "django_session" - SET "session_data" = %s, - "expire_date" = %s - WHERE "django_session"."session_key" = %s - ''', - }), - dict({ - 'origin': list([ - 'Atomic.__exit__[/django/db/transaction.py]', - 'SessionStore.save[/django/contrib/sessions/backends/db.py]', - ]), - 'sql': 'RELEASE SAVEPOINT ""', - }), ]), }) # --- -# name: TestUpdateJobSeekerForHire.test_with_job_seeker_without_nir[queries - step 2] +# name: TestUpdateJobSeekerForHire.test_with_job_seeker_without_nir_deprecated[queries - step 2] dict({ 'num_queries': 10, 'queries': list([ @@ -6410,8 +14320,8 @@ }), dict({ 'origin': list([ - 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT "users_user"."id", @@ -6454,10 +14364,10 @@ }), dict({ 'origin': list([ - 'UpdateJobSeekerStep2View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep2View.setup[utils/session.py]', - 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep2View.setup[www/apply/views/submit_views.py]', + 'DeprecatedUpdateJobSeekerStep2View.setup[utils/session.py]', + 'DeprecatedUpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT "companies_company"."id", @@ -6510,7 +14420,7 @@ dict({ 'origin': list([ 'Company.has_member[common_apps/organizations/models.py]', - 'UpdateJobSeekerStep2View.dispatch[www/apply/views/submit_views.py]', + 'DeprecatedUpdateJobSeekerStep2View.dispatch[www/apply/views/submit_views.py]', ]), 'sql': ''' SELECT %s AS "a" @@ -6564,7 +14474,7 @@ ]), }) # --- -# name: TestUpdateJobSeekerForHire.test_with_job_seeker_without_nir[queries - step 3] +# name: TestUpdateJobSeekerForHire.test_with_job_seeker_without_nir_deprecated[queries - step 3] dict({ 'num_queries': 10, 'queries': list([ @@ -6736,8 +14646,8 @@ }), dict({ 'origin': list([ - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT "users_user"."id", @@ -6817,10 +14727,10 @@ }), dict({ 'origin': list([ - 'UpdateJobSeekerStep3View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep3View.setup[utils/session.py]', - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep3View.setup[www/apply/views/submit_views.py]', + 'DeprecatedUpdateJobSeekerStep3View.setup[utils/session.py]', + 'DeprecatedUpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'DeprecatedUpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT "companies_company"."id", @@ -6873,7 +14783,7 @@ dict({ 'origin': list([ 'Company.has_member[common_apps/organizations/models.py]', - 'UpdateJobSeekerStep3View.dispatch[www/apply/views/submit_views.py]', + 'DeprecatedUpdateJobSeekerStep3View.dispatch[www/apply/views/submit_views.py]', ]), 'sql': ''' SELECT %s AS "a" diff --git a/tests/www/apply/test_submit.py b/tests/www/apply/test_submit.py index fb3f8fecab..81bc5b8a3b 100644 --- a/tests/www/apply/test_submit.py +++ b/tests/www/apply/test_submit.py @@ -261,12 +261,21 @@ def test_404_when_trying_to_update_a_prescriber(self, client): company = CompanyFactory(with_jobs=True, with_membership=True) prescriber = PrescriberFactory() client.force_login(company.members.first()) - for viewname in ( + params = { + "job_seeker": prescriber.public_id, + "company": company.pk, + } + url = add_url_params(reverse("job_seekers_views:update_job_seeker_start"), params) + response = client.get(url) + assert response.status_code == 404 + + # TODO(ewen): deprecated URL + for viewname in [ "job_seekers_views:update_job_seeker_step_1_for_hire", "job_seekers_views:update_job_seeker_step_2_for_hire", "job_seekers_views:update_job_seeker_step_3_for_hire", "job_seekers_views:update_job_seeker_step_end_for_hire", - ): + ]: url = reverse(viewname, kwargs={"company_pk": company.pk, "job_seeker_public_id": prescriber.public_id}) response = client.get(url) assert response.status_code == 404 @@ -3415,11 +3424,12 @@ def _check_last_checked_at(self, client, user, sees_warning, sees_verify_link): response = client.get(url) assert response.status_code == 200 - # Check the presence of the verify link - update_url = reverse( - "job_seekers_views:update_job_seeker_step_1", - kwargs={"company_pk": self.company.pk, "job_seeker_public_id": self.job_seeker.public_id}, - ) + params = { + "job_seeker": self.job_seeker.public_id, + "company": self.company.pk, + "from_url": url, + } + update_url = add_url_params(reverse("job_seekers_views:update_job_seeker_start"), params) link_check = assertContains if sees_verify_link else assertNotContains link_check(response, f'Vérifier le profil', html=True) # Check last_checked_at is shown @@ -3464,6 +3474,15 @@ def setup_method(self, settings, mocker): jobseeker_profile__birthdate=datetime.date(1978, 12, 20), title="M", ) + from_url = reverse( + self.FINAL_REDIRECT_VIEW_NAME, + kwargs={"company_pk": self.company.pk, "job_seeker_public_id": self.job_seeker.public_id}, + ) + self.config = { + "apply": {"company_pk": self.company.pk}, + "config": {"from_url": from_url, "session_kind": "job-seeker-update"}, + "job_seeker_pk": self.job_seeker.pk, + } self.step_1_url = reverse( self.STEP_1_VIEW_NAME, kwargs={"company_pk": self.company.pk, "job_seeker_public_id": self.job_seeker.public_id}, @@ -3480,6 +3499,7 @@ def setup_method(self, settings, mocker): self.STEP_END_VIEW_NAME, kwargs={"company_pk": self.company.pk, "job_seeker_public_id": self.job_seeker.public_id}, ) + [self.city] = create_test_cities(["67"], num_per_department=1) self.INFO_MODIFIABLE_PAR_CANDIDAT_UNIQUEMENT = "Informations modifiables par le candidat uniquement" @@ -3491,8 +3511,31 @@ def setup_method(self, settings, mocker): side_effect=mock_get_first_geocoding_data, ) + params = { + "job_seeker": self.job_seeker.public_id, + "company": self.company.pk, + "from_url": from_url, + } + self.start_url = add_url_params(reverse("job_seekers_views:update_job_seeker_start"), params) + + def get_job_seeker_session_key(self, client): + [job_seeker_session_key] = [ + k for k in client.session.keys() if k not in KNOWN_SESSION_KEYS and not k.startswith("job_application") + ] or [None] + return job_seeker_session_key + + def get_step_url(self, step, client): + viewname = f"job_seekers_views:update_job_seeker_step_{step}" + return reverse(viewname, kwargs={"session_uuid": self.get_job_seeker_session_key(client)}) + def _check_nothing_permitted(self, client, user): client.force_login(user) + + response = client.get(self.start_url) + assert response.status_code == 403 + + def _check_nothing_permitted_deprecated(self, client, user): + client.force_login(user) for url in [ self.step_1_url, self.step_2_url, @@ -3503,6 +3546,11 @@ def _check_nothing_permitted(self, client, user): assert response.status_code == 403 def _check_that_last_step_doesnt_crash_with_direct_access(self, client, user): + client.force_login(user) + client.get(self.start_url) # Setup job_seeker_session + client.get(self.get_step_url("end", client)) # Use partial job_seeker_session + + def _check_that_last_step_doesnt_crash_with_direct_access_deprecated(self, client, user): client.force_login(user) client.get(self.step_1_url) # Setup job_seeker_session client.get(self.step_end_url) # Use partial job_seeker_session @@ -3510,9 +3558,199 @@ def _check_that_last_step_doesnt_crash_with_direct_access(self, client, user): def _check_everything_allowed(self, client, snapshot, user, extra_post_data_1=None): client.force_login(user) + # START + with assertSnapshotQueries(snapshot(name="queries - start")): + response = client.get(self.start_url) + assert client.session[self.get_job_seeker_session_key(client)] == self.config + assertRedirects(response, self.get_step_url("1", client)) + # STEP 1 with assertSnapshotQueries(snapshot(name="queries - step 1")): - response = client.get(self.step_1_url) + response = client.get(self.get_step_url("1", client)) + assertContains(response, self.job_seeker.first_name) + assertNotContains(response, self.INFO_MODIFIABLE_PAR_CANDIDAT_UNIQUEMENT) + + # Let's check for consistency between the NIR, the birthdate and the title. + # (but do not check when there is no NIR) + # ---------------------------------------------------------------------- + + if self.job_seeker.jobseeker_profile.nir != "": + post_data = { + "title": "MME", # Inconsistent title + "first_name": self.job_seeker.first_name, + "last_name": self.job_seeker.last_name, + "birthdate": self.job_seeker.jobseeker_profile.birthdate, + "lack_of_nir": False, + "lack_of_nir_reason": "", + } + response = client.post(self.get_step_url("1", client), data=post_data) + assertContains(response, JobSeekerProfile.ERROR_JOBSEEKER_INCONSISTENT_NIR_TITLE % "") + + post_data = { + "title": "M", + "first_name": self.job_seeker.first_name, + "last_name": self.job_seeker.last_name, + "birthdate": datetime.date(1978, 11, 20), # Inconsistent birthdate + "lack_of_nir": False, + "lack_of_nir_reason": "", + } + response = client.post(self.get_step_url("1", client), data=post_data) + assertContains(response, JobSeekerProfile.ERROR_JOBSEEKER_INCONSISTENT_NIR_BIRTHDATE % "") + + # Resume to valid data and proceed with "normal" flow. + # ---------------------------------------------------------------------- + + NEW_FIRST_NAME = "New first name" + PROCESS_TITLE = "Modification du compte candidat" + + post_data = { + "title": "M", + "first_name": NEW_FIRST_NAME, + "last_name": "New last name", + "birthdate": self.job_seeker.jobseeker_profile.birthdate, + "lack_of_nir": False, + "lack_of_nir_reason": "", + } + if extra_post_data_1 is not None: + post_data.update(extra_post_data_1) + response = client.post(self.get_step_url("1", client), data=post_data) + assertRedirects(response, self.get_step_url("2", client), fetch_redirect_response=False) + + # Data is stored in the session but user is untouched + # (nir value is retrieved from the job_seeker and stored in the session) + lack_of_nir_reason = post_data.pop("lack_of_nir_reason") + nir = post_data.pop("nir", None) + birthdate = post_data.pop("birthdate", None) + birth_place = post_data.pop("birth_place", None) + birth_country = post_data.pop("birth_country", None) + expected_job_seeker_session = { + "user": post_data, + "profile": { + "birth_place": birth_place or self.job_seeker.jobseeker_profile.birth_place, + "birth_country": birth_country or self.job_seeker.jobseeker_profile.birth_country, + "birthdate": birthdate or self.job_seeker.jobseeker_profile.birthdate, + "nir": nir or self.job_seeker.jobseeker_profile.nir, + "lack_of_nir_reason": lack_of_nir_reason, + }, + } | self.config + assert client.session[self.get_job_seeker_session_key(client)] == expected_job_seeker_session + self.job_seeker.refresh_from_db() + assert self.job_seeker.first_name != NEW_FIRST_NAME + + # If you go back to step 1, new data is shown + response = client.get(self.get_step_url("1", client)) + assertContains(response, PROCESS_TITLE, html=True) + assertContains(response, NEW_FIRST_NAME) + + # STEP 2 + with assertSnapshotQueries(snapshot(name="queries - step 2")): + response = client.get(self.get_step_url("2", client)) + assertContains(response, PROCESS_TITLE, html=True) + assertContains(response, self.job_seeker.phone) + assertNotContains(response, self.INFO_MODIFIABLE_PAR_CANDIDAT_UNIQUEMENT) + + NEW_ADDRESS_LINE = "382 ROUTE DE JOLLIVET" + + fields = [NEW_ADDRESS_LINE, f"{self.city.post_codes[0]} {self.city}"] + new_geocoding_address = ", ".join([field for field in fields if field]) + + post_data = { + "ban_api_resolved_address": new_geocoding_address, + "address_line_1": NEW_ADDRESS_LINE, + "post_code": self.city.post_codes[0], + "insee_code": self.city.code_insee, + "city": self.city.name, + "phone": self.job_seeker.phone, + "fill_mode": "ban_api", + } + + response = client.post(self.get_step_url("2", client), data=post_data) + assertRedirects(response, self.get_step_url("3", client), fetch_redirect_response=False) + + # Data is stored in the session but user is untouched + expected_job_seeker_session["user"] |= post_data | {"address_line_2": "", "address_for_autocomplete": None} + assert client.session[self.get_job_seeker_session_key(client)] == expected_job_seeker_session + self.job_seeker.refresh_from_db() + assert self.job_seeker.address_line_1 != NEW_ADDRESS_LINE + + # If you go back to step 2, new data is shown + response = client.get(self.get_step_url("2", client)) + assertContains(response, NEW_ADDRESS_LINE) + + # STEP 3 + with assertSnapshotQueries(snapshot(name="queries - step 3")): + response = client.get(self.get_step_url("3", client)) + assertContains(response, PROCESS_TITLE, html=True) + assertContains(response, "Niveau de formation") + + post_data = { + "education_level": EducationLevel.BAC_LEVEL.value, + } + response = client.post(self.get_step_url("3", client), data=post_data) + assertRedirects(response, self.get_step_url("end", client), fetch_redirect_response=False) + + # Data is stored in the session but user & profiles are untouched + expected_job_seeker_session["profile"] |= post_data | { + "pole_emploi_id": "", + "lack_of_pole_emploi_id_reason": LackOfPoleEmploiId.REASON_NOT_REGISTERED, + "resourceless": False, + "rqth_employee": False, + "oeth_employee": False, + "pole_emploi": False, + "pole_emploi_id_forgotten": "", + "pole_emploi_since": "", + "unemployed": False, + "unemployed_since": "", + "rsa_allocation": False, + "has_rsa_allocation": RSAAllocation.NO.value, + "rsa_allocation_since": "", + "ass_allocation": False, + "ass_allocation_since": "", + "aah_allocation": False, + "aah_allocation_since": "", + } + assert client.session[self.get_job_seeker_session_key(client)] == expected_job_seeker_session + self.job_seeker.refresh_from_db() + + # If you go back to step 3, new data is shown + response = client.get(self.get_step_url("3", client)) + assertContains(response, '', html=True) + + # Step END + response = client.get(self.get_step_url("end", client)) + assertContains(response, PROCESS_TITLE, html=True) + assertContains(response, NEW_FIRST_NAME.title()) # User.get_full_name() changes the firstname display + assertContains(response, NEW_ADDRESS_LINE) + assertContains(response, "Formation de niveau BAC") + assertContains(response, "Valider les informations") + + previous_last_checked_at = self.job_seeker.last_checked_at + + response = client.post(self.get_step_url("end", client)) + assertRedirects( + response, + reverse( + self.FINAL_REDIRECT_VIEW_NAME, + kwargs={"company_pk": self.company.pk, "job_seeker_public_id": self.job_seeker.public_id}, + ), + fetch_redirect_response=False, + ) + assert client.session.get(self.get_job_seeker_session_key(client)) is None + + self.job_seeker.refresh_from_db() + assert self.job_seeker.has_jobseeker_profile is True + assert self.job_seeker.first_name == NEW_FIRST_NAME + assert self.job_seeker.address_line_1 == NEW_ADDRESS_LINE + self.job_seeker.jobseeker_profile.refresh_from_db() + assert self.job_seeker.jobseeker_profile.education_level == EducationLevel.BAC_LEVEL + + assert self.job_seeker.last_checked_at != previous_last_checked_at + + def _check_everything_allowed_deprecated(self, client, snapshot, user, extra_post_data_1=None): + client.force_login(user) + + # STEP 1 + response = client.get(self.step_1_url) assertContains(response, self.job_seeker.first_name) assertNotContains(response, self.INFO_MODIFIABLE_PAR_CANDIDAT_UNIQUEMENT) @@ -3697,6 +3935,95 @@ def _check_everything_allowed(self, client, snapshot, user, extra_post_data_1=No def _check_only_administrative_allowed(self, client, user): client.force_login(user) + # START + response = client.get(self.start_url) + expected_job_seeker_session = self.config + assert client.session[self.get_job_seeker_session_key(client)] == expected_job_seeker_session + assertRedirects(response, self.get_step_url("1", client)) + + # STEP 1 + response = client.get(self.get_step_url("1", client)) + assertContains(response, self.job_seeker.first_name) + assertContains(response, self.INFO_MODIFIABLE_PAR_CANDIDAT_UNIQUEMENT) + + response = client.post(self.get_step_url("1", client)) + assertRedirects(response, self.get_step_url("2", client), fetch_redirect_response=False) + expected_job_seeker_session |= {"user": {}} + assert client.session[self.get_job_seeker_session_key(client)] == expected_job_seeker_session + + # STEP 2 + response = client.get(self.get_step_url("2", client)) + assertContains(response, self.job_seeker.phone) + assertContains(response, self.INFO_MODIFIABLE_PAR_CANDIDAT_UNIQUEMENT) + + response = client.post(self.get_step_url("2", client)) + assertRedirects(response, self.get_step_url("3", client), fetch_redirect_response=False) + + # Data is stored in the session but user is untouched + assert client.session[self.get_job_seeker_session_key(client)] == expected_job_seeker_session + + # STEP 3 + response = client.get(self.get_step_url("3", client)) + assertContains(response, "Niveau de formation") + + post_data = { + "education_level": EducationLevel.BAC_LEVEL.value, + } + response = client.post(self.get_step_url("3", client), data=post_data) + assertRedirects(response, self.get_step_url("end", client), fetch_redirect_response=False) + + # Data is stored in the session but user & profiles are untouched + expected_job_seeker_session["profile"] = post_data | { + "pole_emploi_id": "", + "lack_of_pole_emploi_id_reason": LackOfPoleEmploiId.REASON_NOT_REGISTERED, + "resourceless": False, + "rqth_employee": False, + "oeth_employee": False, + "pole_emploi": False, + "pole_emploi_id_forgotten": "", + "pole_emploi_since": "", + "unemployed": False, + "unemployed_since": "", + "rsa_allocation": False, + "has_rsa_allocation": RSAAllocation.NO.value, + "rsa_allocation_since": "", + "ass_allocation": False, + "ass_allocation_since": "", + "aah_allocation": False, + "aah_allocation_since": "", + } + assert client.session[self.get_job_seeker_session_key(client)] == expected_job_seeker_session + self.job_seeker.refresh_from_db() + + # If you go back to step 3, new data is shown + response = client.get(self.get_step_url("3", client)) + assertContains(response, '', html=True) + + # Step END + response = client.get(self.get_step_url("end", client)) + assertContains(response, "Formation de niveau BAC") + + previous_last_checked_at = self.job_seeker.last_checked_at + + response = client.post(self.get_step_url("end", client)) + assertRedirects( + response, + reverse( + self.FINAL_REDIRECT_VIEW_NAME, + kwargs={"company_pk": self.company.pk, "job_seeker_public_id": self.job_seeker.public_id}, + ), + fetch_redirect_response=False, + ) + assert client.session.get(self.get_job_seeker_session_key(client)) is None + + self.job_seeker.refresh_from_db() + assert self.job_seeker.has_jobseeker_profile is True + assert self.job_seeker.jobseeker_profile.education_level == EducationLevel.BAC_LEVEL + assert self.job_seeker.last_checked_at != previous_last_checked_at + + def _check_only_administrative_allowed_deprecated(self, client, user): + client.force_login(user) + # STEP 1 response = client.get(self.step_1_url) assertContains(response, self.job_seeker.first_name) @@ -3787,6 +4114,11 @@ class TestUpdateJobSeeker(UpdateJobSeekerTestMixin): STEP_END_VIEW_NAME = "job_seekers_views:update_job_seeker_step_end" FINAL_REDIRECT_VIEW_NAME = "apply:application_jobs" + def test_anonymous_start(self, client): + response = client.get(self.start_url) + assertRedirects(response, add_url_params(reverse("account_login"), {"next": self.start_url})) + + # TODO(ewen): deprecated def test_anonymous_step_1(self, client): response = client.get(self.step_1_url) assertRedirects(response, reverse("account_login") + f"?next={self.step_1_url}") @@ -3805,10 +4137,12 @@ def test_anonymous_step_end(self, client): def test_as_job_seeker(self, client): self._check_nothing_permitted(client, self.job_seeker) + self._check_nothing_permitted_deprecated(client, self.job_seeker) def test_as_unauthorized_prescriber(self, client): prescriber = PrescriberOrganizationWithMembershipFactory(authorized=False).members.first() self._check_nothing_permitted(client, prescriber) + self._check_nothing_permitted_deprecated(client, prescriber) def test_as_unauthorized_prescriber_that_created_proxied_job_seeker(self, client, snapshot): prescriber = PrescriberOrganizationWithMembershipFactory(authorized=False).members.first() @@ -3829,6 +4163,25 @@ def test_as_unauthorized_prescriber_that_created_proxied_job_seeker(self, client }, ) + def test_as_unauthorized_prescriber_that_created_proxied_job_seeker_deprecated(self, client, snapshot): + prescriber = PrescriberOrganizationWithMembershipFactory(authorized=False).members.first() + self.job_seeker.created_by = prescriber + self.job_seeker.last_login = None + self.job_seeker.save(update_fields=["created_by", "last_login"]) + + geispolsheim = create_city_geispolsheim() + birthdate = self.job_seeker.jobseeker_profile.birthdate + + self._check_everything_allowed_deprecated( + client, + snapshot, + prescriber, + extra_post_data_1={ + "birth_place": Commune.objects.by_insee_code_and_period(geispolsheim.code_insee, birthdate).id, + "birth_country": Country.france_id, + }, + ) + def test_as_unauthorized_prescriber_that_created_the_non_proxied_job_seeker(self, client): prescriber = PrescriberOrganizationWithMembershipFactory(authorized=False).members.first() self.job_seeker.created_by = prescriber @@ -3836,6 +4189,7 @@ def test_as_unauthorized_prescriber_that_created_the_non_proxied_job_seeker(self self.job_seeker.last_login = timezone.now() - relativedelta(months=1) self.job_seeker.save(update_fields=["created_by", "last_login"]) self._check_nothing_permitted(client, prescriber) + self._check_nothing_permitted_deprecated(client, prescriber) def test_as_authorized_prescriber_with_proxied_job_seeker(self, client, snapshot): # Make sure the job seeker does not manage its own account @@ -3857,12 +4211,33 @@ def test_as_authorized_prescriber_with_proxied_job_seeker(self, client, snapshot }, ) + def test_as_authorized_prescriber_with_proxied_job_seeker_deprecated(self, client, snapshot): + # Make sure the job seeker does not manage its own account + self.job_seeker.created_by = PrescriberFactory() + self.job_seeker.last_login = None + self.job_seeker.save(update_fields=["created_by", "last_login"]) + authorized_prescriber = PrescriberOrganizationWithMembershipFactory(authorized=True).members.first() + + geispolsheim = create_city_geispolsheim() + birthdate = self.job_seeker.jobseeker_profile.birthdate + + self._check_everything_allowed_deprecated( + client, + snapshot, + authorized_prescriber, + extra_post_data_1={ + "birth_place": Commune.objects.by_insee_code_and_period(geispolsheim.code_insee, birthdate).id, + "birth_country": Country.france_id, + }, + ) + def test_as_authorized_prescriber_with_non_proxied_job_seeker(self, client): # Make sure the job seeker does manage its own account self.job_seeker.last_login = timezone.now() - relativedelta(months=1) self.job_seeker.save(update_fields=["last_login"]) authorized_prescriber = PrescriberOrganizationWithMembershipFactory(authorized=True).members.first() self._check_only_administrative_allowed(client, authorized_prescriber) + self._check_only_administrative_allowed_deprecated(client, authorized_prescriber) def test_as_company_with_proxied_job_seeker(self, client, snapshot): # Make sure the job seeker does not manage its own account @@ -3883,14 +4258,46 @@ def test_as_company_with_proxied_job_seeker(self, client, snapshot): }, ) + def test_as_company_with_proxied_job_seeker_deprecated(self, client, snapshot): + # Make sure the job seeker does not manage its own account + self.job_seeker.created_by = EmployerFactory() + self.job_seeker.last_login = None + self.job_seeker.save(update_fields=["created_by", "last_login"]) + + geispolsheim = create_city_geispolsheim() + birthdate = self.job_seeker.jobseeker_profile.birthdate + + self._check_everything_allowed_deprecated( + client, + snapshot, + self.company.members.first(), + extra_post_data_1={ + "birth_place": Commune.objects.by_insee_code_and_period(geispolsheim.code_insee, birthdate).id, + "birth_country": Country.france_id, + }, + ) + def test_as_company_with_non_proxied_job_seeker(self, client): # Make sure the job seeker does manage its own account self.job_seeker.last_login = timezone.now() - relativedelta(months=1) self.job_seeker.save(update_fields=["last_login"]) self._check_only_administrative_allowed(client, self.company.members.first()) + self._check_only_administrative_allowed_deprecated(client, self.company.members.first()) - def test_without_job_seeker_session(self, client): + def test_with_invalid_job_seeker_session(self, client): client.force_login(self.company.members.first()) + invalid_session_name = uuid.uuid4() + kwargs = {"session_uuid": invalid_session_name} + for url in [ + reverse("job_seekers_views:update_job_seeker_step_1", kwargs=kwargs), + reverse("job_seekers_views:update_job_seeker_step_2", kwargs=kwargs), + reverse("job_seekers_views:update_job_seeker_step_3", kwargs=kwargs), + reverse("job_seekers_views:update_job_seeker_step_end", kwargs=kwargs), + ]: + response = client.get(url) + assert response.status_code == 404 + + # TODO(ewen): deprecated for url in [ self.step_2_url, self.step_3_url, @@ -3927,12 +4334,41 @@ def test_with_job_seeker_without_nir(self, client, snapshot): # Check that we could update its NIR infos assert self.job_seeker.jobseeker_profile.lack_of_nir_reason == LackOfNIRReason.TEMPORARY_NUMBER + def test_with_job_seeker_without_nir_deprecated(self, client, snapshot): + # Make sure the job seeker does not manage its own account (and has no nir) + self.job_seeker.jobseeker_profile.nir = "" + self.job_seeker.jobseeker_profile.lack_of_nir_reason = "" + self.job_seeker.jobseeker_profile.save(update_fields=["nir", "lack_of_nir_reason"]) + + self.job_seeker.created_by = EmployerFactory() + self.job_seeker.last_login = None + self.job_seeker.save(update_fields=["created_by", "last_login"]) + + geispolsheim = create_city_geispolsheim() + birthdate = self.job_seeker.jobseeker_profile.birthdate + + self._check_everything_allowed_deprecated( + client, + snapshot, + self.company.members.first(), + extra_post_data_1={ + "nir": "", + "lack_of_nir": True, + "lack_of_nir_reason": LackOfNIRReason.TEMPORARY_NUMBER.value, + "birth_place": Commune.objects.by_insee_code_and_period(geispolsheim.code_insee, birthdate).id, + "birth_country": Country.france_id, + }, + ) + # Check that we could update its NIR infos + assert self.job_seeker.jobseeker_profile.lack_of_nir_reason == LackOfNIRReason.TEMPORARY_NUMBER + def test_as_company_that_last_step_doesnt_crash_with_direct_access(self, client): # Make sure the job seeker does not manage its own account self.job_seeker.created_by = EmployerFactory() self.job_seeker.last_login = None self.job_seeker.save(update_fields=["created_by", "last_login"]) self._check_that_last_step_doesnt_crash_with_direct_access(client, self.company.members.first()) + self._check_that_last_step_doesnt_crash_with_direct_access_deprecated(client, self.company.members.first()) class TestUpdateJobSeekerForHire(UpdateJobSeekerTestMixin): @@ -3942,6 +4378,11 @@ class TestUpdateJobSeekerForHire(UpdateJobSeekerTestMixin): STEP_END_VIEW_NAME = "job_seekers_views:update_job_seeker_step_end_for_hire" FINAL_REDIRECT_VIEW_NAME = "job_seekers_views:check_job_seeker_info_for_hire" + def test_anonymous_start(self, client): + response = client.get(self.start_url) + assertRedirects(response, add_url_params(reverse("account_login"), {"next": self.start_url})) + + # TODO(ewen): deprecated def test_anonymous_step_1(self, client): response = client.get(self.step_1_url) assertRedirects(response, reverse("account_login") + f"?next={self.step_1_url}") @@ -3960,17 +4401,32 @@ def test_anonymous_step_end(self, client): def test_as_job_seeker(self, client): self._check_nothing_permitted(client, self.job_seeker) + self._check_nothing_permitted_deprecated(client, self.job_seeker) def test_as_unauthorized_prescriber(self, client): prescriber = PrescriberOrganizationWithMembershipFactory(authorized=False).members.first() self._check_nothing_permitted(client, prescriber) + self._check_nothing_permitted_deprecated(client, prescriber) - def test_as_unauthorized_prescriber_that_created_proxied_job_seeker(self, client): + def test_as_unauthorized_prescriber_that_created_proxied_job_seeker(self, client, snapshot): prescriber = PrescriberOrganizationWithMembershipFactory(authorized=False).members.first() self.job_seeker.created_by = prescriber self.job_seeker.last_login = None self.job_seeker.save(update_fields=["created_by", "last_login"]) - self._check_nothing_permitted(client, prescriber) + + geispolsheim = create_city_geispolsheim() + birthdate = self.job_seeker.jobseeker_profile.birthdate + + self._check_everything_allowed( + client, + snapshot, + prescriber, + extra_post_data_1={ + "birth_place": Commune.objects.by_insee_code_and_period(geispolsheim.code_insee, birthdate).id, + "birth_country": Country.france_id, + }, + ) + self._check_nothing_permitted_deprecated(client, prescriber) def test_as_unauthorized_prescriber_that_created_the_non_proxied_job_seeker(self, client): prescriber = PrescriberOrganizationWithMembershipFactory(authorized=False).members.first() @@ -3979,21 +4435,36 @@ def test_as_unauthorized_prescriber_that_created_the_non_proxied_job_seeker(self self.job_seeker.last_login = timezone.now() - relativedelta(months=1) self.job_seeker.save(update_fields=["created_by", "last_login"]) self._check_nothing_permitted(client, prescriber) + self._check_nothing_permitted_deprecated(client, prescriber) - def test_as_authorized_prescriber_with_proxied_job_seeker(self, client): + def test_as_authorized_prescriber_with_proxied_job_seeker(self, client, snapshot): # Make sure the job seeker does not manage its own account self.job_seeker.created_by = PrescriberFactory() self.job_seeker.last_login = None self.job_seeker.save(update_fields=["created_by", "last_login"]) authorized_prescriber = PrescriberOrganizationWithMembershipFactory(authorized=True).members.first() - self._check_nothing_permitted(client, authorized_prescriber) + + geispolsheim = create_city_geispolsheim() + birthdate = self.job_seeker.jobseeker_profile.birthdate + + self._check_everything_allowed( + client, + snapshot, + authorized_prescriber, + extra_post_data_1={ + "birth_place": Commune.objects.by_insee_code_and_period(geispolsheim.code_insee, birthdate).id, + "birth_country": Country.france_id, + }, + ) + self._check_nothing_permitted_deprecated(client, authorized_prescriber) def test_as_authorized_prescriber_with_non_proxied_job_seeker(self, client): # Make sure the job seeker does manage its own account self.job_seeker.last_login = timezone.now() - relativedelta(months=1) self.job_seeker.save(update_fields=["last_login"]) authorized_prescriber = PrescriberOrganizationWithMembershipFactory(authorized=True).members.first() - self._check_nothing_permitted(client, authorized_prescriber) + self._check_only_administrative_allowed(client, authorized_prescriber) + self._check_nothing_permitted_deprecated(client, authorized_prescriber) def test_as_company_with_proxied_job_seeker(self, client, snapshot): # Make sure the job seeker does not manage its own account @@ -4014,14 +4485,46 @@ def test_as_company_with_proxied_job_seeker(self, client, snapshot): }, ) + def test_as_company_with_proxied_job_seeker_deprecated(self, client, snapshot): + # Make sure the job seeker does not manage its own account + self.job_seeker.created_by = EmployerFactory() + self.job_seeker.last_login = None + self.job_seeker.save(update_fields=["created_by", "last_login"]) + + geispolsheim = create_city_geispolsheim() + birthdate = self.job_seeker.jobseeker_profile.birthdate + + self._check_everything_allowed_deprecated( + client, + snapshot, + self.company.members.first(), + extra_post_data_1={ + "birth_place": Commune.objects.by_insee_code_and_period(geispolsheim.code_insee, birthdate).id, + "birth_country": Country.france_id, + }, + ) + def test_as_company_with_non_proxied_job_seeker(self, client): # Make sure the job seeker does manage its own account self.job_seeker.last_login = timezone.now() - relativedelta(months=1) self.job_seeker.save(update_fields=["last_login"]) self._check_only_administrative_allowed(client, self.company.members.first()) + self._check_only_administrative_allowed_deprecated(client, self.company.members.first()) - def test_without_job_seeker_session(self, client): + def test_with_invalid_job_seeker_session(self, client): client.force_login(self.company.members.first()) + invalid_session_name = uuid.uuid4() + kwargs = {"session_uuid": invalid_session_name} + for url in [ + reverse("job_seekers_views:update_job_seeker_step_1", kwargs=kwargs), + reverse("job_seekers_views:update_job_seeker_step_2", kwargs=kwargs), + reverse("job_seekers_views:update_job_seeker_step_3", kwargs=kwargs), + reverse("job_seekers_views:update_job_seeker_step_end", kwargs=kwargs), + ]: + response = client.get(url) + assert response.status_code == 404 + + # TODO(ewen): deprecated for url in [ self.step_2_url, self.step_3_url, @@ -4058,12 +4561,41 @@ def test_with_job_seeker_without_nir(self, client, snapshot): # Check that we could update its NIR infos assert self.job_seeker.jobseeker_profile.lack_of_nir_reason == LackOfNIRReason.TEMPORARY_NUMBER + def test_with_job_seeker_without_nir_deprecated(self, client, snapshot): + # Make sure the job seeker does not manage its own account (and has no nir) + self.job_seeker.jobseeker_profile.nir = "" + self.job_seeker.jobseeker_profile.lack_of_nir_reason = "" + self.job_seeker.jobseeker_profile.save(update_fields=["nir", "lack_of_nir_reason"]) + + self.job_seeker.created_by = EmployerFactory() + self.job_seeker.last_login = None + self.job_seeker.save(update_fields=["created_by", "last_login"]) + + geispolsheim = create_city_geispolsheim() + birthdate = self.job_seeker.jobseeker_profile.birthdate + + self._check_everything_allowed_deprecated( + client, + snapshot, + self.company.members.first(), + extra_post_data_1={ + "nir": "", + "lack_of_nir": True, + "lack_of_nir_reason": LackOfNIRReason.TEMPORARY_NUMBER.value, + "birth_place": Commune.objects.by_insee_code_and_period(geispolsheim.code_insee, birthdate).id, + "birth_country": Country.france_id, + }, + ) + # Check that we could update its NIR infos + assert self.job_seeker.jobseeker_profile.lack_of_nir_reason == LackOfNIRReason.TEMPORARY_NUMBER + def test_as_company_that_last_step_doesnt_crash_with_direct_access(self, client): # Make sure the job seeker does not manage its own account self.job_seeker.created_by = EmployerFactory() self.job_seeker.last_login = None self.job_seeker.save(update_fields=["created_by", "last_login"]) self._check_that_last_step_doesnt_crash_with_direct_access(client, self.company.members.first()) + self._check_that_last_step_doesnt_crash_with_direct_access_deprecated(client, self.company.members.first()) class TestUpdateJobSeekerStep3View: @@ -4080,6 +4612,32 @@ def test_job_seeker_with_profile_has_check_boxes_ticked_in_step3(self, client): ) apply_session.save() + # START to setup jobseeker session + params = { + "job_seeker": job_seeker.public_id, + "company": company.pk, + } + url = add_url_params(reverse("job_seekers_views:update_job_seeker_start"), params) + response = client.get(url) + assert response.status_code == 302 + + # Go straight to STEP 3 + [job_seeker_session_name] = [ + k for k in client.session.keys() if k not in KNOWN_SESSION_KEYS and not k.startswith("job_application") + ] + response = client.get( + reverse( + "job_seekers_views:update_job_seeker_step_3", + kwargs={"session_uuid": job_seeker_session_name}, + ) + ) + assertContains( + response, + '', + html=True, + ) + + # TODO(ewen): Deprecated # STEP 1 to setup jobseeker session response = client.get( reverse( @@ -4857,12 +5415,11 @@ def test_company(self, client): jobseeker_profile__lack_of_nir_reason=LackOfNIRReason.TEMPORARY_NUMBER, ) client.force_login(company.members.first()) - response = client.get( - reverse( - "job_seekers_views:check_job_seeker_info_for_hire", - kwargs={"company_pk": company.pk, "job_seeker_public_id": job_seeker.public_id}, - ) + url_check_infos = reverse( + "job_seekers_views:check_job_seeker_info_for_hire", + kwargs={"company_pk": company.pk, "job_seeker_public_id": job_seeker.public_id}, ) + response = client.get(url_check_infos) assertContains( response, '

Informations personnelles de Son Prénom Son Nom De Famille

', @@ -4870,13 +5427,16 @@ def test_company(self, client): ) assertTemplateNotUsed(response, "approvals/includes/box.html") assertContains(response, "Éligibilité IAE à valider") - assertContains( - response, - reverse( - "job_seekers_views:update_job_seeker_step_1_for_hire", - kwargs={"company_pk": company.pk, "job_seeker_public_id": job_seeker.public_id}, - ), - ) + params = { + "job_seeker": job_seeker.public_id, + "company": company.pk, + "from_url": url_check_infos, + } + url_update = f""" + Mettre à jour + """ + assertContains(response, url_update, html=True) assertContains( response, reverse( @@ -4900,25 +5460,27 @@ def test_geiq(self, client): jobseeker_profile__lack_of_nir_reason=LackOfNIRReason.TEMPORARY_NUMBER, ) client.force_login(company.members.first()) - response = client.get( - reverse( - "job_seekers_views:check_job_seeker_info_for_hire", - kwargs={"company_pk": company.pk, "job_seeker_public_id": job_seeker.public_id}, - ) + url_check_infos = reverse( + "job_seekers_views:check_job_seeker_info_for_hire", + kwargs={"company_pk": company.pk, "job_seeker_public_id": job_seeker.public_id}, ) + response = client.get(url_check_infos) assertContains( response, '

Informations personnelles de Son Prénom Son Nom De Famille

', html=True, ) assertTemplateNotUsed(response, "approvals/includes/box.html") - assertContains( - response, - reverse( - "job_seekers_views:update_job_seeker_step_1_for_hire", - kwargs={"company_pk": company.pk, "job_seeker_public_id": job_seeker.public_id}, - ), - ) + params = { + "job_seeker": job_seeker.public_id, + "company": company.pk, + "from_url": url_check_infos, + } + url_update = f""" + Mettre à jour + """ + assertContains(response, url_update, html=True) assertContains( response, reverse( diff --git a/tests/www/job_seekers_views/test_create_or_update.py b/tests/www/job_seekers_views/test_create_or_update.py index 7b1f631b67..65ba8be4bb 100644 --- a/tests/www/job_seekers_views/test_create_or_update.py +++ b/tests/www/job_seekers_views/test_create_or_update.py @@ -1,4 +1,5 @@ import datetime +import uuid import pytest from django.urls import reverse @@ -6,10 +7,11 @@ from itou.asp.models import Commune, Country from itou.users.enums import Title +from itou.utils.session import SessionNamespace +from itou.utils.urls import add_url_params from tests.companies.factories import CompanyFactory -from tests.users.factories import ( - JobSeekerFactory, -) +from tests.prescribers.factories import PrescriberOrganizationWithMembershipFactory +from tests.users.factories import JobSeekerFactory from tests.utils.test import KNOWN_SESSION_KEYS @@ -190,6 +192,133 @@ def test_birth_country_france_and_no_birthplace(self, client): ) +class TestUpdateJobSeeker: + def test_update_with_wrong_tunnel_in_session(self, client): + job_seeker = JobSeekerFactory() + company = CompanyFactory(with_membership=True) + prescriber = PrescriberOrganizationWithMembershipFactory(authorized=True).members.first() + client.force_login(prescriber) + + # Create a session with a wrong tunnel key + job_seeker_session = SessionNamespace.create_uuid_namespace( + client.session, + data={ + "config": {"from_url": reverse("dashboard:index"), "session_kind": "job-seeker-get-or-create-sender"}, + "job_seeker_pk": job_seeker.pk, + "apply": {"company_pk": company.pk}, + }, + ) + job_seeker_session.save() + + url = reverse("job_seekers_views:update_job_seeker_step_1", kwargs={"session_uuid": job_seeker_session.name}) + response = client.get(url) + + assert response.status_code == 404 + + +class TestUpdateJobSeekerStart: + def test_update_start_with_valid_parameters(self, client): + job_seeker = JobSeekerFactory() + company = CompanyFactory(with_membership=True) + user = company.members.get() + client.force_login(user) + + from_url = reverse( + "apply:application_jobs", kwargs={"company_pk": company.pk, "job_seeker_public_id": job_seeker.public_id} + ) + params = {"job_seeker": job_seeker.public_id, "company": company.pk, "from_url": from_url} + start_url = add_url_params(reverse("job_seekers_views:update_job_seeker_start"), params) + + response = client.get(start_url) + [job_seeker_session_name] = [k for k in client.session.keys() if k not in KNOWN_SESSION_KEYS] + step_1_url = reverse( + "job_seekers_views:update_job_seeker_step_1", + kwargs={"session_uuid": job_seeker_session_name}, + ) + + assertRedirects(response, step_1_url) + assert client.session[job_seeker_session_name].get("config").get("from_url") == from_url + response = client.get(step_1_url) + assertContains( + response, + f""" + + + Annuler + + """, + html=True, + ) + + def test_update_start_with_invalid_parameters(self, client): + job_seeker = JobSeekerFactory() + company = CompanyFactory(with_membership=True) + user = company.members.get() + client.force_login(user) + + # Invalid uuid + params = {"job_seeker": "invalid_uuid", "company": company.pk} + start_url = add_url_params(reverse("job_seekers_views:update_job_seeker_start"), params) + response = client.get(start_url) + assert response.status_code == 404 + + # Valid UUID but no job seeker associated to it + params = { + "job_seeker": uuid.uuid4(), + "company": company.pk, + } + start_url = add_url_params(reverse("job_seekers_views:update_job_seeker_start"), params) + response = client.get(start_url) + assert response.status_code == 404 + + # No company parameter + params = { + "job_seeker": job_seeker.public_id, + } + start_url = add_url_params(reverse("job_seekers_views:update_job_seeker_start"), params) + response = client.get(start_url) + assert response.status_code == 404 + + # Invalid company parameter + params = { + "job_seeker": job_seeker.public_id, + "company": "stringAndNotNumber", + } + start_url = add_url_params(reverse("job_seekers_views:update_job_seeker_start"), params) + response = client.get(start_url) + assert response.status_code == 404 + + # No from_url parameter + params = { + "job_seeker": job_seeker.public_id, + "company": company.pk, + } + start_url = add_url_params(reverse("job_seekers_views:update_job_seeker_start"), params) + response = client.get(start_url) + + [job_seeker_session_name] = [k for k in client.session.keys() if k not in KNOWN_SESSION_KEYS] + step_1_url = reverse( + "job_seekers_views:update_job_seeker_step_1", + kwargs={"session_uuid": job_seeker_session_name}, + ) + assert client.session[job_seeker_session_name].get("config").get("from_url") == reverse("dashboard:index") + response = client.get(step_1_url) + assertContains( + response, + f""" + + + Annuler + + """, + html=True, + ) + + class TestUpdateJobSeekerStep1: @pytest.mark.parametrize( "born_in_france", [pytest.param(True, id="born_in_france"), pytest.param(False, id="born_outside_france")] @@ -200,11 +329,20 @@ def test_create_step_1(self, born_in_france, client): job_seeker = JobSeekerFactory(created_by=user, title=Title.M, jobseeker_profile__nir="111116411111144") client.force_login(user) + # Init session + params = { + "job_seeker": job_seeker.public_id, + "company": company.pk, + } + start_url = add_url_params(reverse("job_seekers_views:update_job_seeker_start"), params) + client.get(start_url) + [job_seeker_session_name] = [k for k in client.session.keys() if k not in KNOWN_SESSION_KEYS] + birthdate = datetime.date(1911, 11, 1) response = client.post( reverse( "job_seekers_views:update_job_seeker_step_1", - kwargs={"job_seeker_public_id": job_seeker.public_id, "company_pk": company.pk}, + kwargs={"session_uuid": job_seeker_session_name}, ), { "title": Title.M, @@ -225,7 +363,7 @@ def test_create_step_1(self, born_in_france, client): response, reverse( "job_seekers_views:update_job_seeker_step_2", - kwargs={"job_seeker_public_id": job_seeker.public_id, "company_pk": company.pk}, + kwargs={"session_uuid": job_seeker_session_name}, ), ) @@ -235,11 +373,20 @@ def test_birth_country_not_france_and_birthplace(self, client): job_seeker = JobSeekerFactory(created_by=user, title=Title.M, jobseeker_profile__nir="111116411111144") client.force_login(user) + # Init session + params = { + "job_seeker": job_seeker.public_id, + "company": company.pk, + } + start_url = add_url_params(reverse("job_seekers_views:update_job_seeker_start"), params) + client.get(start_url) + [job_seeker_session_name] = [k for k in client.session.keys() if k not in KNOWN_SESSION_KEYS] + birthdate = datetime.date(1911, 11, 1) response = client.post( reverse( "job_seekers_views:update_job_seeker_step_1", - kwargs={"job_seeker_public_id": job_seeker.public_id, "company_pk": company.pk}, + kwargs={"session_uuid": job_seeker_session_name}, ), { "title": Title.M, @@ -266,10 +413,19 @@ def test_birth_country_france_and_no_birthplace(self, client): job_seeker = JobSeekerFactory(created_by=user, title=Title.M, jobseeker_profile__nir="111116411111144") client.force_login(user) + # Init session + params = { + "job_seeker": job_seeker.public_id, + "company": company.pk, + } + start_url = add_url_params(reverse("job_seekers_views:update_job_seeker_start"), params) + client.get(start_url) + [job_seeker_session_name] = [k for k in client.session.keys() if k not in KNOWN_SESSION_KEYS] + response = client.post( reverse( "job_seekers_views:update_job_seeker_step_1", - kwargs={"job_seeker_public_id": job_seeker.public_id, "company_pk": company.pk}, + kwargs={"session_uuid": job_seeker_session_name}, ), { "title": Title.M,