I had a similar problem and I solved it by introducing a new helper get_scenario_risk_job:
https://github.com/gem/oq-engine/pull/1037/files#L7R1030

Not that you should use that, for the ScenarioRisk it is fine as it is. The comment is just to stress out that writing tests for the risk is a PITA :-(