@@ -669,13 +669,13 @@ def test_resolve_events_parameter_mapping(
669669 linked_event_id = EVENTS_DATA ["data" ][0 ]["id" ]
670670 organisation_id = to_global_id ("OrganisationNode" , organisation .id )
671671 PalvelutarjotinEventFactory (linked_event_id = linked_event_id )
672- with patch .object (LinkedEventsApiClient , "list" ) as linkedEventsApiClientMock :
672+ with patch .object (LinkedEventsApiClient , "list" ) as linked_events_api_client_mock :
673673 api_client .execute (
674674 GET_EVENTS_QUERY ,
675675 variables = {"organisationId" : organisation_id , given : ["test" ]},
676676 )
677677
678- linkedEventsApiClientMock .assert_called_with (
678+ linked_events_api_client_mock .assert_called_with (
679679 "event" ,
680680 filter_list = {"publisher" : organisation .publisher_id , expected : ["test" ]},
681681 is_event_staff = False ,
@@ -980,12 +980,16 @@ def test_create_event_with_null_organisation_id(
980980 ) in executed ["errors" ][0 ]["message" ]
981981
982982
983- @pytest .mark .parametrize ("organisationId " , ["" , " " , " " * 10 ])
983+ @pytest .mark .parametrize ("organisation_id " , ["" , " " , " " * 10 ])
984984def test_create_event_with_empty_or_whitespace_only_organisation_id (
985- event_staff_api_client , person , mock_create_event_data , organisation , organisationId
985+ event_staff_api_client ,
986+ person ,
987+ mock_create_event_data ,
988+ organisation ,
989+ organisation_id ,
986990):
987991 variables = deepcopy (CREATE_EVENT_VARIABLES )
988- variables ["input" ]["organisationId" ] = organisationId
992+ variables ["input" ]["organisationId" ] = organisation_id
989993 variables ["input" ]["pEvent" ]["contactPersonId" ] = to_global_id (
990994 "PersonNode" , person .id
991995 )
@@ -1353,12 +1357,16 @@ def test_update_event_with_null_organisation_id(
13531357 ) in executed ["errors" ][0 ]["message" ]
13541358
13551359
1356- @pytest .mark .parametrize ("organisationId " , ["" , " " , " " * 10 ])
1360+ @pytest .mark .parametrize ("organisation_id " , ["" , " " , " " * 10 ])
13571361def test_update_event_with_empty_or_whitespace_only_organisation_id (
1358- event_staff_api_client , person , mock_update_event_data , organisation , organisationId
1362+ event_staff_api_client ,
1363+ person ,
1364+ mock_update_event_data ,
1365+ organisation ,
1366+ organisation_id ,
13591367):
13601368 variables = deepcopy (UPDATE_EVENT_VARIABLES )
1361- variables ["input" ]["organisationId" ] = organisationId
1369+ variables ["input" ]["organisationId" ] = organisation_id
13621370 variables ["input" ]["pEvent" ]["contactPersonId" ] = to_global_id (
13631371 "PersonNode" , person .id
13641372 )
@@ -1927,24 +1935,24 @@ def test_get_upcoming_events(
19271935 Event are ordered so that the event with the next upcoming occurrence is first.
19281936 """
19291937 mocked_responses .assert_all_requests_are_fired = False
1930- UPCOMING_MOCKED_EVENTS = []
1938+ upcoming_mocked_events = []
19311939
19321940 for i in range (1 , 4 ):
19331941 p_event = PalvelutarjotinEventFactory (
19341942 linked_event_id = f"kultus:{ i } " , organisation = organisation
19351943 )
1936- MOCK_EVENT_DATA = {** EVENT_DATA , "id" : p_event .linked_event_id }
1944+ mock_event_data = {** EVENT_DATA , "id" : p_event .linked_event_id }
19371945 mocked_responses .add (
19381946 responses .GET ,
19391947 url = settings .LINKED_EVENTS_API_CONFIG ["ROOT" ]
19401948 + f"event/{ p_event .linked_event_id } /" ,
1941- json = MOCK_EVENT_DATA ,
1949+ json = mock_event_data ,
19421950 )
19431951 mocked_responses .add (
19441952 responses .PUT ,
19451953 url = settings .LINKED_EVENTS_API_CONFIG ["ROOT" ]
19461954 + f"event/{ p_event .linked_event_id } /" ,
1947- json = MOCK_EVENT_DATA ,
1955+ json = mock_event_data ,
19481956 )
19491957
19501958 if cancelled :
@@ -1967,7 +1975,7 @@ def test_get_upcoming_events(
19671975 end = start + timedelta (hours = 1 )
19681976 OccurrenceFactory .create (p_event = p_event , start_time = start , end_time = end )
19691977
1970- UPCOMING_MOCKED_EVENTS .append (MOCK_EVENT_DATA )
1978+ upcoming_mocked_events .append (mock_event_data )
19711979
19721980 if upcoming :
19731981 ds = settings .LINKED_EVENTS_API_CONFIG ["DATA_SOURCE" ]
@@ -1977,11 +1985,11 @@ def test_get_upcoming_events(
19771985 url = f"{ settings .LINKED_EVENTS_API_CONFIG ['ROOT' ]} event/?{ query_string } " ,
19781986 json = {
19791987 "meta" : {
1980- "count" : len (UPCOMING_MOCKED_EVENTS ),
1988+ "count" : len (upcoming_mocked_events ),
19811989 "next" : None ,
19821990 "previous" : None ,
19831991 },
1984- "data" : UPCOMING_MOCKED_EVENTS ,
1992+ "data" : upcoming_mocked_events ,
19851993 },
19861994 )
19871995
0 commit comments