def new_func(*a, **kw):
     flush_mongo()
     func(*a, **kw)
 def new_func(*a, **kw):
     connect_to_test_db()
     flush_mongo()
     func(*a, **kw)
     flush_mongo()