solidify unit test

This commit is contained in:
Rachid Mrad 2024-06-10 22:43:40 -04:00
parent 2586f10342
commit 7809ab5978
No known key found for this signature in database
2 changed files with 34 additions and 12 deletions

View file

@ -220,7 +220,7 @@ class DomainRequestWizard(DomainRequestWizardPermissionView, TemplateView):
self.storage["domain_request_id"] = kwargs["id"]
self.storage["step_history"] = self.db_check_for_unlocking_steps()
# if accessing this class directly, redirect to either to an acknowledgement
# if accessing this class directly, redirect to either to an acknowledgement
# page or to the first step in the processes (if an edit rather than a new request);
# subclasseswill NOT be redirected. The purpose of this is to allow code to
# send users "to the domain request wizard" without needing to know which view
@ -234,7 +234,7 @@ class DomainRequestWizard(DomainRequestWizardPermissionView, TemplateView):
return render(request, "domain_request_intro.html", context={})
else:
return self.goto(self.steps.first)
context = self.get_context_data()
self.steps.current = current_url
context["forms"] = self.get_forms()
@ -462,10 +462,8 @@ class DomainRequestWizard(DomainRequestWizardPermissionView, TemplateView):
# if user has acknowledged the intro message
if button == "intro_acknowledge":
print("intro_acknowledge")
if request.path_info == self.NEW_URL_NAME:
print("Creating DomainRequest...")
last_submit_time = request.session.get('last_submit_time', 0)
last_submit_time = request.session.get("last_submit_time", 0)
# Check if the last submit was very recent, indicating a back button -> submit sequence
if current_time - last_submit_time > 5: # 5 seconds threshold
@ -474,7 +472,7 @@ class DomainRequestWizard(DomainRequestWizardPermissionView, TemplateView):
del self.storage
# Update the last submit time
request.session['last_submit_time'] = current_time
request.session["last_submit_time"] = current_time
return self.goto(self.steps.first)