"""Test Account Note.""" from tests.utils.db_utils import create_test_account_note, create_test_subaccount_note def test_dataload_account_notes(fixture_client): """Test account note dataload endpoint.""" create_test_account_note(vendor_id=1, note="foo", updated_by="baz") create_test_account_note(vendor_id=3, note="bar", updated_by="baz") result = fixture_client.post("/account-note/dataloader", json=[1, 2, 3]) assert result.status_code == 200 assert result.json == [ {"vendor_id": 1, "note": "foo"}, {"vendor_id": 2, "note": None}, {"vendor_id": 3, "note": "bar"}, ] def test_dataload_subaccount_notes(fixture_client): """Test subaccount note dataload endpoint.""" create_test_subaccount_note(subaccount_id=1, note="foo", updated_by="baz") create_test_subaccount_note(subaccount_id=3, note="bar", updated_by="baz") result = fixture_client.post("/subaccount-note/dataloader", json=[1, 2, 3]) assert result.status_code == 200 assert result.json == [ {"subaccount_id": 1, "note": "foo"}, {"subaccount_id": 2, "note": None}, {"subaccount_id": 3, "note": "bar"}, ]