Linting / fix unit test passing in debug

This commit is contained in:
zandercymatics 2024-04-16 15:32:33 -06:00
parent 582f35bc07
commit 50ede03476
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
2 changed files with 4 additions and 7 deletions

View file

@ -118,10 +118,7 @@ class Command(BaseCommand):
try: try:
if request.generic_org_type is not None: if request.generic_org_type is not None:
domain_name = None domain_name = None
if ( if request.requested_domain is not None and request.requested_domain.name is not None:
request.requested_domain is not None and
request.requested_domain.name is not None
):
domain_name = request.requested_domain.name domain_name = request.requested_domain.name
request_is_approved = request.state == DomainRequest.DomainRequestStatus.APPROVED request_is_approved = request.state == DomainRequest.DomainRequestStatus.APPROVED
@ -195,7 +192,7 @@ class Command(BaseCommand):
ScriptDataHelper.bulk_update_fields( ScriptDataHelper.bulk_update_fields(
DomainInformation, self.di_to_update, ["organization_type", "is_election_board", "generic_org_type"] DomainInformation, self.di_to_update, ["organization_type", "is_election_board", "generic_org_type"]
) )
# Log what happened # Log what happened
log_header = "============= FINISHED UPDATE FOR DOMAININFORMATION ===============" log_header = "============= FINISHED UPDATE FOR DOMAININFORMATION ==============="
TerminalHelper.log_script_run_summary( TerminalHelper.log_script_run_summary(

View file

@ -98,7 +98,7 @@ class TestPopulateOrganizationType(MockEppLib):
"registrar.management.commands.utility.terminal_helper.TerminalHelper.query_yes_no_exit", # noqa "registrar.management.commands.utility.terminal_helper.TerminalHelper.query_yes_no_exit", # noqa
return_value=True, return_value=True,
): ):
call_command("populate_organization_type", "registrar/tests/data/fake_election_domains.csv", debug=True) call_command("populate_organization_type", "registrar/tests/data/fake_election_domains.csv")
def assert_expected_org_values_on_request_and_info( def assert_expected_org_values_on_request_and_info(
self, self,
@ -118,7 +118,7 @@ class TestPopulateOrganizationType(MockEppLib):
expected_values (dict): Container for what we expect is_electionboard, generic_org_type, expected_values (dict): Container for what we expect is_electionboard, generic_org_type,
and organization_type to be on DomainRequest and DomainInformation. and organization_type to be on DomainRequest and DomainInformation.
Example: Example:
expected_values = { expected_values = {
"is_election_board": False, "is_election_board": False,
"generic_org_type": DomainRequest.OrganizationChoices.CITY, "generic_org_type": DomainRequest.OrganizationChoices.CITY,