from datetime import datetime, timedelta from tests.root_fixture import root_fixture fixture = { **root_fixture, "User": [ { "id": 1, "email": "dev-marketing-user-1@example.com", "external_id": "sme-dna|5cf0091d6c91d310fe6fcdc6", "is_service_account": False, "name": "First User", "phone": "", }, { "id": 2, "email": "user-2@example.com", "external_id": "sme-dna|user-2", "updated_at": "2019-11-06 16:49:53.973942+02", "is_service_account": False, "name": "User2", "phone": "", }, { "id": 3, "email": "user-3@example.com", "external_id": "sme-dna|user-3", "updated_at": "2019-11-06 16:49:53.973942+02", "is_service_account": False, "is_admin": True, "name": "User Admin", "phone": "", }, { "id": 42, "email": "suprauser42@example.com", "external_id": "sme-dna|user-42", "updated_at": "2019-11-06 16:49:53.973942+02", "is_service_account": True, "name": "Universe Boss", "phone": "", }, { "id": 33, "email": "user3@example.com", "external_id": "sme-dna|user-33", "updated_at": "2019-11-06 16:49:53.973942+02", "is_service_account": False, "is_admin": True, "name": "User3", "phone": "", } ], "CampaignTypeCity": [{"id": 100, "name": "New York"}], "Project": [ { "id": 500, "name": "test_project_1", "label_id": 1, "created_at": "2019-07-22 16:14:35.748032", "create_user_id": 1, "updated_at": "2019-07-22 16:14:55.446196", "edit_user_id": 1, "is_deleted": False, "is_claimed": True, "end_date": datetime.strftime(datetime.now() + timedelta(days=200), "%Y-%m-%d"), "is_confidential": False, "budget": 66666, "currency": "GBP", "allocation": 66666, "initial_start_date": "2022-10-11", "gras_title": "New Frontline Release", "gras_project_code": "12345514", "prs_title": "New Frontline Release(PRS)", "prs_project_code": "012345514", "updated_by_import_at": "2020-10-11", }, { "id": 501, "name": "test_project_501", "label_id": 1, "created_at": "2019-07-22 16:14:35.748032", "create_user_id": 1, "updated_at": "2019-07-22 16:14:55.446196", "edit_user_id": 1, "is_deleted": False, "is_claimed": True, "end_date": datetime.strftime(datetime.now() + timedelta(days=200), "%Y-%m-%d"), "is_confidential": False, "budget": 66666, "currency": "GBP", "allocation": 66666, "initial_start_date": "2022-10-11", "gras_title": "New Frontline Release the best", "gras_project_code": "12345514", "prs_title": "New Frontline Release(PRS)", "prs_project_code": "012345514", "updated_by_import_at": "2020-10-11", }, ], "Label": [ { "id": 1, "name": "Columbia Records", "abbreviation": "CR", "country": "UK", "rep_owner_key": "123456", "external_name": "Columbia Records", "child_rep_owner_keys": "{}", }, { "id": 2, "name": "Epic Records", "abbreviation": "ER", "rep_owner_key": "223456", "country": "US", "external_name": "Epic Records", "child_rep_owner_keys": "{}", }, { "id": 3, "name": "RCA Records", "abbreviation": "RR", "rep_owner_key": "323456", "country": "GB", "external_name": "RCA Records", "child_rep_owner_keys": "{}", }, {"id": 4, "name": "CMG", "rep_owner_key": "423456", "external_name": "CMG", "child_rep_owner_keys": "{}"}, { "id": 5, "name": "Nashville", "rep_owner_key": "523456", "external_name": "Nashville", "child_rep_owner_keys": "{}", }, ], "UserLabel": [ { "user_id": 1, "label_id": 1, }, ], "Playlist": [ {"id": 110, "external_id": "05", "name": "Playlist1", "owner_name": "Owner1", "provider": "apple"}, {"id": 120, "external_id": "06", "name": "Playlist2", "owner_name": "Owner2", "provider": "spotify"}, ], "MediaPlan": [ { "id": 42, "name": "main media plan", "project_id": 500, "order": 0, "create_user_id": 1 }, { "id": 44, "name": "main media plan", "project_id": 501, "order": 0, "create_user_id": 1 }, ], "MediaPlanPhase": [ {"id": 450, "name": "Phase For Test", "media_plan_id": 42, "order": 1}, { "id": 560, "name": "Phase For Test with Asset", "media_plan_id": 42, "order": 2, }, {"id": 550, "name": "Phase For Test [Empty]", "media_plan_id": 42, "order": 3}, {"id": 555, "name": "Phase For Test [All Deleted]", "media_plan_id": 42, "order": 4}, { "id": 700, "name": "def phase", "media_plan_id": 44, "order": 0 } ], "Territory": [ {"id": 0, "name": "GLBL", "code": "GLBL", "territory_type_id": 1}, {"id": 1, "name": "USA", "code": "USA", "territory_type_id": 1}, {"id": 2, "name": "Ukraine", "code": "UA", "territory_type_id": 1}, {"id": 3, "name": "United Kingdom", "code": "GB", "territory_type_id": 1}, ], "CampaignTerritory": [ {"campaign_id": 100, "territory_id": 1, "budget_spend": 5000}, ], "Campaign": [ { "id": 100, "uuid": "34ed4c22-e1f9-4184-a06d-f04cbdb97455", "name": "test_campaign_1", "project_id": 500, "create_user_id": 1, "media_plan_phase_id": 450, "workflow_status": "Draft", "start_date": "2007-10-11", "external_name": "external name", "end_date": "2007-11-10", "planned_budget": 222, "budget_spend": 12, "currency_id": 1, "created_at": "2019-07-22 16:14:55.355226", "updated_at": "2019-07-22 16:14:55.355226", "edit_user_id": 1, "provider_id": 1, "age_range": "[0, 60]", "objective_id": 1, "notes": "Lorem Ipsum", "metainfo": { "fields": { "budget": True, "spend": True, "startDate": True, "endDate": True, "genders": True, "audienceAge": True, "countries": True, "destinations": True, "notes": True, } }, "order_in_phase": 0, "type_id": 8, "gratis": False, }, { "id": 200, "uuid": "34ed4c22-e1f9-4184-a06d-f04cbdb97452", "name": "Pending Approval campaign", "media_plan_phase_id": 700, "project_id": 501, "create_user_id": 1, "workflow_status": "Pending Approval", "start_date": "2007-10-11", "external_name": "external name", "end_date": "2007-11-10", "planned_budget": 222, "budget_spend": 12, "currency_id": 1, "created_at": "2019-07-22 16:14:55.355226", "updated_at": "2019-07-22 16:14:55.355226", "edit_user_id": 1, "provider_id": 1, "age_range": "[0, 60]", "objective_id": 1, "notes": "Lorem Ipsum", "metainfo": { "fields": { "budget": True, "spend": True, "startDate": True, "endDate": True, "genders": True, "audienceAge": True, "countries": True, "destinations": True, "notes": True, } }, "type_id": 8, "gratis": False, }, { "id": 300, "uuid": "34ed4c22-e1f9-4184-a06d-f04cbdb97453", "name": "Approved campaign", "project_id": 501, "create_user_id": 1, "workflow_status": "Approved", "start_date": "2007-10-11", "external_name": "external name", "end_date": "2007-11-10", "planned_budget": 222, "budget_spend": 12, "currency_id": 1, "created_at": "2019-07-22 16:14:55.355226", "updated_at": "2019-07-22 16:14:55.355226", "edit_user_id": 1, "provider_id": 1, "age_range": "[0, 60]", "objective_id": 1, "notes": "Lorem Ipsum", "metainfo": { "fields": { "budget": True, "spend": True, "startDate": True, "endDate": True, "genders": True, "audienceAge": True, "countries": True, "destinations": True, "notes": True, } }, "type_id": 8, "gratis": False, }, { "id": 400, "uuid": "34ed4c22-e1f9-4184-a06d-f04cbdb97411", "name": "test_campaign_4", "project_id": 500, "create_user_id": 1, "media_plan_phase_id": 450, "workflow_status": "Draft", "start_date": "2007-10-11", "external_name": "external name", "end_date": "2007-11-10", "planned_budget": 222, "budget_spend": 12, "currency_id": 1, "created_at": "2019-07-22 16:14:55.355226", "updated_at": "2019-07-22 16:14:55.355226", "edit_user_id": 1, "provider_id": 1, "age_range": "[0, 60]", "objective_id": 1, "notes": "Lorem Ipsum", "metainfo": { "fields": { "budget": True, "spend": True, "startDate": True, "endDate": True, "genders": True, "audienceAge": True, "countries": True, "destinations": True, "notes": True, } }, "order_in_phase": 1, "type_id": 8, "gratis": False, }, ], "ProjectCampaign": [ {"project_id": 500, "campaign_id": 100, "status": 1}, ], "CampaignLink": [{"campaign_id": 100, "link": "www.sony.com"}, {"campaign_id": 100, "link": "www.decibel.com"}], "CampaignGender": [ {"campaign_id": 100, "gender_id": 1}, ], "CampaignPlatformsLinks": [ {"campaign_id": 100, "platform_id": 1}, ], "UserProject": [ {"project_id": 500, "user_id": 1, "shared_by": 1, "editable": False, "role": 1}, {"project_id": 500, "user_id": 2, "shared_by": 1, "editable": False, "role": 3}, {"project_id": 500, "user_id": 3, "shared_by": 1, "editable": False, "role": 1}, {"project_id": 501, "user_id": 1, "shared_by": 1, "editable": False, "role": 1}, {"project_id": 501, "user_id": 3, "shared_by": 1, "editable": False, "role": 1}, ], "ApprovalRequest": [ { "id": 42, "media_plan_id": 44, "requester_id": 3, "reviewer_id": 3, "email_uuid": "42ed4c22-e1f9-4184-a06d-f04cbdb97442" } ], "ApprovalRequestCampaign": [ { "id": 4242, "approval_request_id": 42, "campaign_uuid": "34ed4c22-e1f9-4184-a06d-f04cbdb97452", "expiration_date": datetime.strftime(datetime.now() + timedelta(days=7), "%Y-%m-%d"), "is_deleted": False, "is_approved": False } ], "ProjectTargetItem": [ {"project_id": 500, "entity_id": 10, "entity_type": 0, "add_type": 2}, {"project_id": 501, "entity_id": 20, "entity_type": 0, "add_type": 2}, ], "Image": [ { "id": 13, "url": "https://images-api.atlas.stream/v2/artists/by_gras_participant_id/47369", "width": 200, "height": 250, "related_object_id": 10 }, { "id": 14, "url": "https://images-api.atlas.stream/v2/artists/by_gras_participant_id/47369", "width": 200, "height": 250, "related_object_id": 20 }, ], "Artist": [ {"id": 10, "external_id": "GRAS_123124", "name": "Test Artist", "is_sony": True}, {"id": 20, "external_id": "GRAS_123134324", "name": "TestArtist2", "is_sony": True}, ], "Polymorphable": [ {"id": 10, "type": "Artist"}, {"id": 20, "type": "Artist"}, {"id": 110, "type": "Playlist"}, {"id": 120, "type": "Playlist"}, ], }