mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-12 12:39:43 +02:00
fixed tests
This commit is contained in:
parent
1ca5142b37
commit
9a5ed14e88
2 changed files with 8 additions and 3 deletions
|
@ -682,6 +682,7 @@ class ExportDataTest(MockDbForIndividualTests, MockEppLib):
|
||||||
def test_domain_request_growth(self):
|
def test_domain_request_growth(self):
|
||||||
"""Shows submitted requests within a date range, sorted"""
|
"""Shows submitted requests within a date range, sorted"""
|
||||||
# Remove "Submitted at" because we can't guess this immutable, dynamically generated test data
|
# Remove "Submitted at" because we can't guess this immutable, dynamically generated test data
|
||||||
|
print("we are in here")
|
||||||
columns = [
|
columns = [
|
||||||
"Domain request",
|
"Domain request",
|
||||||
"Domain type",
|
"Domain type",
|
||||||
|
@ -692,6 +693,7 @@ class ExportDataTest(MockDbForIndividualTests, MockEppLib):
|
||||||
# Create a CSV file in memory
|
# Create a CSV file in memory
|
||||||
csv_file = StringIO()
|
csv_file = StringIO()
|
||||||
# Call the export functions
|
# Call the export functions
|
||||||
|
print("something")
|
||||||
DomainRequestGrowth.export_data_to_csv(
|
DomainRequestGrowth.export_data_to_csv(
|
||||||
csv_file,
|
csv_file,
|
||||||
start_date=self.start_date.strftime("%Y-%m-%d"),
|
start_date=self.start_date.strftime("%Y-%m-%d"),
|
||||||
|
@ -699,8 +701,11 @@ class ExportDataTest(MockDbForIndividualTests, MockEppLib):
|
||||||
)
|
)
|
||||||
# Reset the CSV file's position to the beginning
|
# Reset the CSV file's position to the beginning
|
||||||
csv_file.seek(0)
|
csv_file.seek(0)
|
||||||
|
print("uuuuu")
|
||||||
|
print(csv_file)
|
||||||
# Read the content into a variable
|
# Read the content into a variable
|
||||||
csv_content = csv_file.read()
|
csv_content = csv_file.read()
|
||||||
|
print(csv_content)
|
||||||
expected_content = (
|
expected_content = (
|
||||||
"Domain request,Domain type,Federal type\n"
|
"Domain request,Domain type,Federal type\n"
|
||||||
"city3.gov,Federal,Executive\n"
|
"city3.gov,Federal,Executive\n"
|
||||||
|
|
|
@ -1265,11 +1265,11 @@ class DomainRequestExport(BaseExport):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Handle the federal_type field. Defaults to the wrong format.
|
# Handle the federal_type field. Defaults to the wrong format.
|
||||||
federal_type = model.converted_federal_type
|
federal_type = model.get("federal_type")
|
||||||
human_readable_federal_type = BranchChoices.get_branch_label(federal_type) if federal_type else None
|
human_readable_federal_type = BranchChoices.get_branch_label(federal_type) if federal_type else None
|
||||||
|
|
||||||
# Handle the org_type field
|
# Handle the org_type field
|
||||||
org_type = model.converted_generic_org_type
|
org_type = model.get("generic_org_type")
|
||||||
human_readable_org_type = DomainRequest.OrganizationChoices.get_org_label(org_type) if org_type else None
|
human_readable_org_type = DomainRequest.OrganizationChoices.get_org_label(org_type) if org_type else None
|
||||||
|
|
||||||
# Handle the status field. Defaults to the wrong format.
|
# Handle the status field. Defaults to the wrong format.
|
||||||
|
@ -1277,7 +1277,7 @@ class DomainRequestExport(BaseExport):
|
||||||
status_display = DomainRequest.DomainRequestStatus.get_status_label(status) if status else None
|
status_display = DomainRequest.DomainRequestStatus.get_status_label(status) if status else None
|
||||||
|
|
||||||
# Handle the region field.
|
# Handle the region field.
|
||||||
state_territory = model.converted_state_territory
|
state_territory = model.get("state_territory")
|
||||||
region = get_region(state_territory) if state_territory else None
|
region = get_region(state_territory) if state_territory else None
|
||||||
|
|
||||||
# Handle the requested_domain field (add a default if None)
|
# Handle the requested_domain field (add a default if None)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue