"""Functional tests for POST /goals/{productId} endpoint.""" import json def test_sales_goal_create_with_hmv_notes( test_database, client, valid_post_header): """Test hmv notes are added to the database.""" valid_post_header.pop('Grass-Account-Type') valid_post_header.pop('Grass-Account-Id') test_product_id = 1 expected_result = 'are provided' test_request_body = { 'sales_goals': { 'hmv_notes': expected_result } } result = client.post( '/goals/{}'.format(test_product_id), headers=valid_post_header, data=json.dumps(test_request_body)) response_body = json.loads(result.get_data(as_text=True)) assert result.status_code == 200 assert response_body.get('hmv_notes') == expected_result