mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-12 05:58:18 +02:00
Add unit test
This commit is contained in:
parent
fe29eaa9fb
commit
0f92f588a8
3 changed files with 34 additions and 17 deletions
|
@ -46,19 +46,13 @@ class Command(BaseCommand):
|
|||
except Exception as err:
|
||||
self.failed_to_update.append(domain)
|
||||
logger.error(err)
|
||||
logger.error(
|
||||
f"{TerminalColors.FAIL}"
|
||||
f"Failed to update {domain}"
|
||||
f"{TerminalColors.ENDC}"
|
||||
)
|
||||
|
||||
logger.error(f"{TerminalColors.FAIL}" f"Failed to update {domain}" f"{TerminalColors.ENDC}")
|
||||
|
||||
# Do a bulk update on all fields
|
||||
ScriptDataHelper.bulk_update_fields(Domain, self.to_update, ["first_ready"])
|
||||
|
||||
# Log what happened
|
||||
TerminalHelper.log_script_run_summary(
|
||||
self.to_update, self.failed_to_update, self.skipped, debug
|
||||
)
|
||||
TerminalHelper.log_script_run_summary(self.to_update, self.failed_to_update, self.skipped, debug)
|
||||
|
||||
def update_first_ready_for_domain(self, domain: Domain, debug: bool):
|
||||
"""Grabs the created_at field and associates it with the first_ready column.
|
||||
|
@ -72,4 +66,4 @@ class Command(BaseCommand):
|
|||
else:
|
||||
self.skipped.append(domain)
|
||||
if debug:
|
||||
logger.warning(f"Skipped updating {domain}")
|
||||
logger.warning(f"Skipped updating {domain}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue