Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
chopkinsmade committed Dec 13, 2024
1 parent 017e0cb commit b677f62
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions datahub/search/contact/test/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,20 +586,19 @@ def test_export(

reader = DictReader(StringIO(response.getvalue().decode('utf-8-sig')))
assert reader.fieldnames == list(SearchContactExportAPIView.field_titles.values())
expected_company_link = (
f'{settings.DATAHUB_FRONTEND_URL_PREFIXES["company"]}/{contact.company.pk}'
)
front_end_prefixes = settings.DATAHUB_FRONTEND_URL_PREFIXES

expected_row_data = format_csv_data(
[
{
'Name': contact.name,
'Job title': contact.job_title,
'Date created': contact.created_on,
'Archived': contact.archived,
'Link': f'{settings.DATAHUB_FRONTEND_URL_PREFIXES["contact"]}/{contact.pk}',
'Link': f'{front_end_prefixes["contact"]}/{contact.pk}',
'Company': get_attr_or_none(contact, 'company.name'),
'Company sector': get_attr_or_none(contact, 'company.sector.name'),
'Company link': expected_company_link,
'Company link': f'{front_end_prefixes["company"]}/{contact.company.pk}',
'Company UK region': get_attr_or_none(contact, 'company.uk_region.name'),
'Area': (
(contact.company.address_area and contact.company.address_area.name)
Expand Down

0 comments on commit b677f62

Please sign in to comment.