Serialise org notes and billing details

This commit is contained in:
Pea Tyczynska
2021-02-04 17:33:46 +00:00
parent 02bc87c096
commit aa7bc3d9b4
2 changed files with 15 additions and 0 deletions

View File

@@ -434,6 +434,11 @@ class Organisation(db.Model):
"domains": self.domain_list,
"request_to_go_live_notes": self.request_to_go_live_notes,
"count_of_live_services": len(self.live_services),
"notes": self.notes,
"purchase_order_number": self.purchase_order_number,
"billing_contact_names": self.billing_contact_names,
"billing_contact_email_addresses": self.billing_contact_email_addresses,
"billing_reference": self.billing_reference,
}
def serialize_for_list(self):

View File

@@ -77,6 +77,11 @@ def test_get_organisation_by_id(admin_request, notify_db_session):
'domains',
'request_to_go_live_notes',
'count_of_live_services',
'notes',
'billing_contact_names',
'billing_contact_email_addresses',
'billing_reference',
'purchase_order_number'
}
assert response['id'] == str(org.id)
assert response['name'] == 'test_org_1'
@@ -93,6 +98,11 @@ def test_get_organisation_by_id(admin_request, notify_db_session):
assert response['count_of_live_services'] == 0
assert response['agreement_signed_on_behalf_of_name'] is None
assert response['agreement_signed_on_behalf_of_email_address'] is None
assert response['notes'] is None
assert response['billing_contact_names'] is None
assert response['billing_contact_email_addresses'] is None
assert response['billing_reference'] is None
assert response['purchase_order_number'] is None
def test_get_organisation_by_id_returns_domains(admin_request, notify_db_session):