55from murfey .util .db import DataCollectionGroup , GridSquare
66from murfey .util .models import GridSquareParameters
77from murfey .workflows .spa import flush_spa_preprocess
8+ from tests .conftest import ExampleVisit
89
910
1011@mock .patch ("murfey.workflows.spa.flush_spa_preprocess._transport_object" )
@@ -16,7 +17,7 @@ def test_register_grid_square_update_add_locations(
1617 grid_square = GridSquare (
1718 id = 1 ,
1819 name = 101 ,
19- session_id = 2 ,
20+ session_id = ExampleVisit . murfey_session_id ,
2021 tag = "session_tag" ,
2122 )
2223 murfey_db_session .add (grid_square )
@@ -58,7 +59,7 @@ def test_register_grid_square_update_add_nothing(
5859 grid_square = GridSquare (
5960 id = 1 ,
6061 name = 101 ,
61- session_id = 2 ,
62+ session_id = ExampleVisit . murfey_session_id ,
6263 tag = "session_tag" ,
6364 x_location = 0.1 ,
6465 y_location = 0.2 ,
@@ -92,7 +93,7 @@ def test_register_grid_square_insert_with_ispyb(
9293 # Create a data collection group for lookups
9394 grid_square = DataCollectionGroup (
9495 id = 1 ,
95- session_id = 2 ,
96+ session_id = ExampleVisit . murfey_session_id ,
9697 tag = "session_tag" ,
9798 atlas_id = 90 ,
9899 )
@@ -131,7 +132,7 @@ def test_register_grid_square_insert_with_ispyb(
131132 grid_square_final_parameters = murfey_db_session .exec (select (GridSquare )).one ()
132133 assert grid_square_final_parameters .id == 1
133134 assert grid_square_final_parameters .name == 101
134- assert grid_square_final_parameters .session_id == 2
135+ assert grid_square_final_parameters .session_id == ExampleVisit . murfey_session_id
135136 assert grid_square_final_parameters .tag == "session_tag"
136137 assert grid_square_final_parameters .x_location == 1.1
137138 assert grid_square_final_parameters .y_location == 1.2
0 commit comments