mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-16 01:27:03 +02:00
enhance tests with more domain statuses
This commit is contained in:
parent
73d88314af
commit
d624c22088
2 changed files with 18 additions and 9 deletions
|
@ -22,10 +22,10 @@ class ExportDataTest(TestCase):
|
|||
name="cdomain1.gov", state=Domain.State.READY
|
||||
)
|
||||
self.domain_2, _ = Domain.objects.get_or_create(
|
||||
name="adomain2.gov", state=Domain.State.READY
|
||||
name="adomain2.gov", state=Domain.State.DNS_NEEDED
|
||||
)
|
||||
self.domain_3, _ = Domain.objects.get_or_create(
|
||||
name="ddomain3.gov", state=Domain.State.READY
|
||||
name="ddomain3.gov", state=Domain.State.ON_HOLD
|
||||
)
|
||||
self.domain_4, _ = Domain.objects.get_or_create(
|
||||
name="bdomain4.gov", state=Domain.State.UNKNOWN
|
||||
|
@ -90,7 +90,13 @@ class ExportDataTest(TestCase):
|
|||
"Status",
|
||||
]
|
||||
sort_fields = ["domain__name"]
|
||||
filter_condition = {"domain__state": Domain.State.READY}
|
||||
filter_condition = {
|
||||
"domain__state__in": [
|
||||
Domain.State.READY,
|
||||
Domain.State.DNS_NEEDED,
|
||||
Domain.State.ON_HOLD,
|
||||
],
|
||||
}
|
||||
|
||||
# Call the export function
|
||||
export_domains_to_writer(writer, columns, sort_fields, filter_condition)
|
||||
|
@ -107,12 +113,10 @@ class ExportDataTest(TestCase):
|
|||
"Domain name,Domain type,Federal agency,Organization name,City,State,AO,"
|
||||
"AO email,Submitter,Submitter title,Submitter email,Submitter phone,"
|
||||
"Security Contact Email,Status\n"
|
||||
"adomain2.gov,interstate,ready\n"
|
||||
"adomain2.gov,interstate,dnsneeded\n"
|
||||
"cdomain1.gov,federal,World War I Centennial Commission,ready\n"
|
||||
"ddomain3.gov,federal,Armed Forces Retirement Home,ready\n"
|
||||
"ddomain3.gov,federal,Armed Forces Retirement Home,onhold\n"
|
||||
)
|
||||
# print(csv_content)
|
||||
# self.maxDiff = None
|
||||
|
||||
# Normalize line endings and remove commas,
|
||||
# spaces and leading/trailing whitespace
|
||||
|
@ -148,7 +152,11 @@ class ExportDataTest(TestCase):
|
|||
sort_fields = ["domain__name", "federal_agency", "organization_type"]
|
||||
filter_condition = {
|
||||
"organization_type__icontains": "federal",
|
||||
"domain__state": Domain.State.READY,
|
||||
"domain__state__in": [
|
||||
Domain.State.READY,
|
||||
Domain.State.DNS_NEEDED,
|
||||
Domain.State.ON_HOLD,
|
||||
],
|
||||
}
|
||||
|
||||
# Call the export function
|
||||
|
|
|
@ -36,6 +36,7 @@ def export_domains_to_writer(writer, columns, sort_fields, filter_condition):
|
|||
if security_contacts
|
||||
else " ",
|
||||
"Status": domainInfo.domain.state,
|
||||
"Expiration Date": domainInfo.domain.expiration_date,
|
||||
}
|
||||
writer.writerow([FIELDS.get(column, "") for column in columns])
|
||||
|
||||
|
@ -54,7 +55,7 @@ def export_data_type_to_csv(csv_file):
|
|||
"AO email",
|
||||
"Security Contact Email",
|
||||
"Status",
|
||||
# 'Expiration Date'
|
||||
"Expiration Date",
|
||||
]
|
||||
sort_fields = ["domain__name"]
|
||||
filter_condition = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue