To make this test pass in FAST_COMPILE mode (used in the daily buildbot) you need to use this mode
mode = theano.compile.get_default_mode().including("remove_consider_constant")
and use it in function(...,mode=mode)