fixed a fatal error in testcase caused by rewriting __bases__ attribute of models