def setUp(self): # it is too bad but until we remove usage of AsyncResult in the codebase # there is no way to make these tests synchronous # thus overriding queue config so these tests # use celery in async mode queue.conf['CELERY_ALWAYS_EAGER'] = False WebTest.setUp(self)
def setUp(self): WebTest.setUp(self) # add reports just for testing report_created = PersistentReport( user_id=self.owner_user_id, status=celery.states.PENDING, queue_result_key=None, show_in_ui=True ) report_started = PersistentReport( user_id=self.owner_user_id, status=celery.states.STARTED, queue_result_key=None, show_in_ui=True ) report_started2 = PersistentReport( user_id=self.owner_user_id, status=celery.states.STARTED, queue_result_key=None, show_in_ui=True ) report_finished = PersistentReport( user_id=self.owner_user_id, status=celery.states.SUCCESS, queue_result_key=None, show_in_ui=True ) self.session.add_all([ report_created, report_started, report_started2, report_finished ]) self.session.commit()
def setUp(self): WebTest.setUp(self) self.cohort_service = CohortService()
def setUp(self): WebTest.setUp(self)
def tearDown(self): queue.conf['CELERY_ALWAYS_EAGER'] = True WebTest.tearDown(self)