Add parameter logic

This commit is contained in:
Rebecca Hsieh 2024-02-14 13:45:33 -08:00
parent 2dbf9cfa84
commit 22cefd6ed8
No known key found for this signature in database
2 changed files with 34 additions and 11 deletions

View file

@ -403,7 +403,10 @@ class ExportDataTest(MockEppLib):
} }
self.maxDiff = None self.maxDiff = None
# Call the export functions # Call the export functions
write_body(writer, columns, sort_fields, filter_condition) write_body(
writer, columns, sort_fields, filter_condition, get_domain_managers=False, should_write_header=True
)
# 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)
# Read the content into a variable # Read the content into a variable
@ -459,7 +462,9 @@ class ExportDataTest(MockEppLib):
], ],
} }
# Call the export functions # Call the export functions
write_body(writer, columns, sort_fields, filter_condition) write_body(
writer, columns, sort_fields, filter_condition, get_domain_managers=False, should_write_header=True
)
# 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)
# Read the content into a variable # Read the content into a variable
@ -507,7 +512,9 @@ class ExportDataTest(MockEppLib):
], ],
} }
# Call the export functions # Call the export functions
write_body(writer, columns, sort_fields, filter_condition) write_body(
writer, columns, sort_fields, filter_condition, get_domain_managers=False, should_write_header=True
)
# 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)
# Read the content into a variable # Read the content into a variable
@ -589,11 +596,17 @@ class ExportDataTest(MockEppLib):
columns, columns,
sort_fields, sort_fields,
filter_condition, filter_condition,
get_domain_managers=False,
should_write_header=True,
) )
write_body( write_body(
writer, columns, sort_fields_for_deleted_domains, filter_conditions_for_deleted_domains, False, False writer,
columns,
sort_fields_for_deleted_domains,
filter_conditions_for_deleted_domains,
get_domain_managers=False,
should_write_header=False,
) )
# 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)
@ -651,7 +664,10 @@ class ExportDataTest(MockEppLib):
} }
self.maxDiff = None self.maxDiff = None
# Call the export functions # Call the export functions
write_body(writer, columns, sort_fields, filter_condition, True, True) write_body(
writer, columns, sort_fields, filter_condition, get_domain_managers=True, should_write_header=True
)
# 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)
# Read the content into a variable # Read the content into a variable

View file

@ -219,7 +219,7 @@ def export_data_type_to_csv(csv_file):
Domain.State.ON_HOLD, Domain.State.ON_HOLD,
], ],
} }
write_body(writer, columns, sort_fields, filter_condition, True, True) write_body(writer, columns, sort_fields, filter_condition, get_domain_managers=True, should_write_header=True)
def export_data_full_to_csv(csv_file): def export_data_full_to_csv(csv_file):
@ -250,7 +250,7 @@ def export_data_full_to_csv(csv_file):
Domain.State.ON_HOLD, Domain.State.ON_HOLD,
], ],
} }
write_body(writer, columns, sort_fields, filter_condition, False, True) write_body(writer, columns, sort_fields, filter_condition, get_domain_managers=False, should_write_header=True)
def export_data_federal_to_csv(csv_file): def export_data_federal_to_csv(csv_file):
@ -282,7 +282,7 @@ def export_data_federal_to_csv(csv_file):
Domain.State.ON_HOLD, Domain.State.ON_HOLD,
], ],
} }
write_body(writer, columns, sort_fields, filter_condition, False, True) write_body(writer, columns, sort_fields, filter_condition, get_domain_managers=False, should_write_header=True)
def get_default_start_date(): def get_default_start_date():
@ -349,5 +349,12 @@ def export_data_growth_to_csv(csv_file, start_date, end_date):
"domain__deleted__gte": start_date_formatted, "domain__deleted__gte": start_date_formatted,
} }
write_body(writer, columns, sort_fields, filter_condition, False, True) write_body(writer, columns, sort_fields, filter_condition, get_domain_managers=False, should_write_header=True)
write_body(writer, columns, sort_fields_for_deleted_domains, filter_condition_for_deleted_domains, False, False) write_body(
writer,
columns,
sort_fields_for_deleted_domains,
filter_condition_for_deleted_domains,
get_domain_managers=False,
should_write_header=False,
)