Usman/lms11189 user api middleware exception 2

LMS-11189

#4670 with another commit
Is there any way we can make this test more specific? i.e. check that the context dictionary *lacks* some value we know that requests with valid IDs will have?