I got a problem when I tried to test a flask app that I can not access the g
variable.
The api which is gonna tested looks like this:
user = query_object.get(g.user_id) # here the exception raises
When I run the test, it raises:
NameError: global name 'g' is not defined