mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-23 19:20:47 +02:00
Remove bad unit test
This commit is contained in:
parent
07690da791
commit
e9af48593d
1 changed files with 0 additions and 74 deletions
|
@ -399,80 +399,6 @@ class ExportDataTest(MockEppLib):
|
||||||
|
|
||||||
self.assertEqual(csv_content, expected_content)
|
self.assertEqual(csv_content, expected_content)
|
||||||
|
|
||||||
def test_export_domains_to_writer_security_emails(self):
|
|
||||||
"""Test that export_domains_to_writer returns the
|
|
||||||
expected security email"""
|
|
||||||
# Create a CSV file in memory
|
|
||||||
csv_file = StringIO()
|
|
||||||
writer = csv.writer(csv_file)
|
|
||||||
|
|
||||||
# Define columns, sort fields, and filter condition
|
|
||||||
columns = [
|
|
||||||
"Domain name",
|
|
||||||
"Domain type",
|
|
||||||
"Agency",
|
|
||||||
"Organization name",
|
|
||||||
"City",
|
|
||||||
"State",
|
|
||||||
"AO",
|
|
||||||
"AO email",
|
|
||||||
"Submitter",
|
|
||||||
"Submitter title",
|
|
||||||
"Submitter email",
|
|
||||||
"Submitter phone",
|
|
||||||
"Security Contact Email",
|
|
||||||
"Status",
|
|
||||||
]
|
|
||||||
sort_fields = ["domain__name"]
|
|
||||||
filter_condition = {
|
|
||||||
"domain__state__in": [
|
|
||||||
Domain.State.READY,
|
|
||||||
Domain.State.DNS_NEEDED,
|
|
||||||
Domain.State.ON_HOLD,
|
|
||||||
],
|
|
||||||
}
|
|
||||||
|
|
||||||
# Add security email information
|
|
||||||
self.domain_1.name = "defaultsecurity.gov"
|
|
||||||
self.domain_1.save()
|
|
||||||
# Invoke setter
|
|
||||||
self.domain_1.security_contact
|
|
||||||
|
|
||||||
# Invoke setter
|
|
||||||
self.domain_2.security_contact
|
|
||||||
|
|
||||||
# Invoke setter
|
|
||||||
self.domain_3.security_contact
|
|
||||||
|
|
||||||
# Call the export functions
|
|
||||||
write_header(writer, columns)
|
|
||||||
write_body(writer, columns, sort_fields, filter_condition)
|
|
||||||
|
|
||||||
# Reset the CSV file's position to the beginning
|
|
||||||
csv_file.seek(0)
|
|
||||||
|
|
||||||
# Read the content into a variable
|
|
||||||
csv_content = csv_file.read()
|
|
||||||
|
|
||||||
# We expect READY domains,
|
|
||||||
# sorted alphabetially by domain name
|
|
||||||
expected_content = (
|
|
||||||
"Domain name,Domain type,Agency,Organization name,City,State,AO,"
|
|
||||||
"AO email,Submitter,Submitter title,Submitter email,Submitter phone,"
|
|
||||||
"Security Contact Email,Status\n"
|
|
||||||
"adomain2.gov,Interstate,(blank),dnsneeded\n"
|
|
||||||
"ddomain3.gov,Federal,Armed Forces Retirement Home,123@mail.gov,onhold\n"
|
|
||||||
"defaultsecurity.gov,Federal - Executive,World War I Centennial Commission,(blank),ready\n"
|
|
||||||
)
|
|
||||||
print(csv_content)
|
|
||||||
|
|
||||||
# Normalize line endings and remove commas,
|
|
||||||
# spaces and leading/trailing whitespace
|
|
||||||
csv_content = csv_content.replace(",,", "").replace(",", "").replace(" ", "").replace("\r\n", "\n").strip()
|
|
||||||
expected_content = expected_content.replace(",,", "").replace(",", "").replace(" ", "").strip()
|
|
||||||
|
|
||||||
self.assertEqual(csv_content, expected_content)
|
|
||||||
|
|
||||||
def test_write_body_additional(self):
|
def test_write_body_additional(self):
|
||||||
"""An additional test for filters and multi-column sort"""
|
"""An additional test for filters and multi-column sort"""
|
||||||
# Create a CSV file in memory
|
# Create a CSV file in memory
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue