Changed to pass Context instance to tests, rather than raw context