()
| 23 | assert project == mock_project |
| 24 | |
| 25 | def test_find_by_id(): |
| 26 | # Create a mock session |
| 27 | session = create_autospec(Session) |
| 28 | |
| 29 | # Create a sample project ID |
| 30 | project_id = 123 |
| 31 | |
| 32 | # Create a mock project object to be returned by the session query |
| 33 | mock_project = Project(id=project_id, name="Test Project", organisation_id=1, description="Project for testing") |
| 34 | |
| 35 | # Configure the session query to return the mock project |
| 36 | session.query.return_value.filter.return_value.first.return_value = mock_project |
| 37 | |
| 38 | # Call the method under test |
| 39 | project = Project.find_by_id(session, project_id) |
| 40 | |
| 41 | # Assert that the returned project object matches the mock project |
| 42 | assert project == mock_project |
nothing calls this directly
no test coverage detected