Make sure the api tests get a valid context

The API context should not use to_dict()
as it expects a MistralContext().

Change-Id: I5ddebacdff8f15d51fd72e032ed960eb5b0d1e41
Merge "Make sure the api tests get a valid context"