def setUp(self): self.cid = None self.aid = None # DO NOT CHANGE HERE dbAdapter = DatabaseAdapter() dbAdapter.connect() dbAdapter.setAutoCommit() # helpers self.authorHelper = AuthorHelper(dbAdapter) self.circleHelper = CircleHelper(dbAdapter) self.postHelper = PostHelper(dbAdapter) self.requestHelper = RequestHelper(dbAdapter) # controllers self.commentController = CommentController(dbAdapter) self.postController = PostController(dbAdapter) self.requestController = RequestController(dbAdapter) self.circleController = CircleController(dbAdapter) self.authorController = AuthorController(dbAdapter) self.postPermissionController = PostPermissionController(dbAdapter) self.serverController = ServerController(dbAdapter) self.serviceController = ServiceController(dbAdapter)
# import all controllers from PostController import * from AuthorController import * from RequestController import * from CommentController import * from ServiceController import * from ServerController import * from PostPermissionController import * from ImageHelper import * DEBUG = True # create a new database obj dbAdapter = DatabaseAdapter() # connect dbAdapter.connect() dbAdapter.setAutoCommit() ahelper = AuthorHelper(dbAdapter) aController = AuthorController(dbAdapter) # use the conneted dbAdapter to initialize postHelper obj postHelper = PostHelper(dbAdapter) postController = PostController(dbAdapter) # reController = RequestController(dbAdapter) # circleHelper = CircleHelper(dbAdapter) circleController = CircleController(dbAdapter) # commentController = CommentController(dbAdapter) settingHelper = SettingHelper(dbAdapter) #