From 79870a5616e2795328d788c0dc012e3fa8b9f256 Mon Sep 17 00:00:00 2001 From: Erin <121973038+erinysong@users.noreply.github.com> Date: Tue, 16 Jan 2024 16:02:35 -0800 Subject: [PATCH] Remove unused files in git diff --- src/epplibwrapper/tests/test_pool.py | 13 ------------- src/migrationdata/README.md | 8 ++++++++ .../management/commands/disclose_security_emails.py | 5 +++-- src/registrar/models/domain.py | 4 ++-- src/registrar/tests/test_models_domain.py | 2 +- 5 files changed, 14 insertions(+), 18 deletions(-) create mode 100644 src/migrationdata/README.md diff --git a/src/epplibwrapper/tests/test_pool.py b/src/epplibwrapper/tests/test_pool.py index 916015980..1c36d26da 100644 --- a/src/epplibwrapper/tests/test_pool.py +++ b/src/epplibwrapper/tests/test_pool.py @@ -246,16 +246,3 @@ class TestConnectionPool(TestCase): expected = "InfoDomain failed to execute due to a connection error." result = registry.send(commands.InfoDomain(name="test.gov"), cleaned=True) self.assertEqual(result, expected) - - @patch.object(EPPLibWrapper, "_test_registry_connection_success", patch_success) - def test_retries_on_transport_error(self): - """A .send is invoked on the pool, but transport error occurs and EPP - retries connection.""" - - with ExitStack() as stack: - stack.enter_context(patch.object(EPPConnectionPool, "_create_socket", self.fake_socket)) - stack.enter_context(patch.object(Socket, "connect", self.fake_client)) - - # Pool should be running - self.assertEqual(registry.pool_status.connection_success, True) - self.assertEqual(registry.pool_status.pool_running, True) diff --git a/src/migrationdata/README.md b/src/migrationdata/README.md new file mode 100644 index 000000000..81190ee3f --- /dev/null +++ b/src/migrationdata/README.md @@ -0,0 +1,8 @@ +## Purpose +Use this folder for storing files for the migration process. Should otherwise be empty on local dev environments unless necessary. This folder must exist due to the nature of how data is stored on cloud.gov and the nature of the data we want to send. + +## How do I migrate registrar data? +This process is detailed in [data_migration.md](../../docs/operations/data_migration.md) + +## What kind of files can I store here? +The intent is for PII data or otherwise, but this can exist in any format. Do note that the data contained in this file will be temporary, so after the app is restaged it will lose it. This is ideal for migration files as they write to our DB, but not for something you need to permanently hold onto. \ No newline at end of file diff --git a/src/registrar/management/commands/disclose_security_emails.py b/src/registrar/management/commands/disclose_security_emails.py index a7ea0d2dd..cdbac2a41 100644 --- a/src/registrar/management/commands/disclose_security_emails.py +++ b/src/registrar/management/commands/disclose_security_emails.py @@ -68,9 +68,10 @@ class Command(BaseCommand): self.domains_with_errors.append(copy.deepcopy(domain.domain_info)) logger.error(f"error retrieving domain {domain.domain_info}: {err}") - # Inform user how many contacts were disclosed and skipped + # Inform user how many contacts were disclosed, skipped, and errored logger.info("Updated %d contacts to disclosed.", len(self.disclosed_domain_contacts)) logger.info( "Skipped disclosing %d contacts with security email registrar@dotgov.gov.", - len(self.skipped_domain_contacts), + len(self.skipped_domain_contacts) ) + logger.info("Error disclosing %d contacts.", len(self.domains_with_errors)) \ No newline at end of file diff --git a/src/registrar/models/domain.py b/src/registrar/models/domain.py index 7f052a581..4d455d320 100644 --- a/src/registrar/models/domain.py +++ b/src/registrar/models/domain.py @@ -1401,8 +1401,8 @@ class Domain(TimeStampedModel, DomainHelper): DF = epp.DiscloseField fields = {DF.EMAIL} disclose = is_security and contact.email != PublicContact.get_default_security().email - # Delete after testing - logger.info("Updated domain contact to disclose: %s", disclose) + # Delete after testing on other devices + logger.info("Updated domain contact %s to disclose: %s", contact.email, disclose) # Will only disclose DF.EMAIL if its not the default return epp.Disclose( flag=disclose, diff --git a/src/registrar/tests/test_models_domain.py b/src/registrar/tests/test_models_domain.py index 81b63e3f6..af9c7b053 100644 --- a/src/registrar/tests/test_models_domain.py +++ b/src/registrar/tests/test_models_domain.py @@ -561,7 +561,7 @@ class TestRegistrantContacts(MockEppLib): "registrar.management.commands.utility.terminal_helper.TerminalHelper.query_yes_no_exit", # noqa return_value=True, ): - call_command("extend_expiration_dates") + call_command("disclose_security_emails") def test_no_security_email(self): """