def test_status_message(self): pd = ProgressData(func_name='test_func_5', unique_id='plokij') pd.total = 42 pd.step('Stepping') self.assertEqual(pd.result()['total'], 42) self.assertEqual(pd.result()['status_message'], 'Stepping')
def test_status_message(self): pd = ProgressData(func_name='test_func_5', unique_id='plokij') pd.total = 42 pd.step('Stepping') self.assertEqual(pd.result()['total'], 42) self.assertEqual(pd.result()['status_message'], 'Stepping') # if we call step again, then the status message should not change pd.step() self.assertEqual(pd.result()['status_message'], 'Stepping') # Now passing in empty string will reset pd.step('') self.assertEqual(pd.result()['status_message'], '')
def test_delete_cache(self): pd = ProgressData(func_name='test_func_4', unique_id='1q2w3e') pd.total = 525600 pd.data['status'] = 'doing-something' pd.save() self.assertEqual(pd.result()['total'], 525600) self.assertEqual(pd.data['status'], 'doing-something') self.assertEqual(pd.delete()['total'], None)
def delete_organization(org_pk): """delete_organization_buildings""" progress_data = ProgressData(func_name='delete_organization', unique_id=org_pk) chain(delete_organization_inventory.si(org_pk, progress_data.key), _delete_organization_related_data.si(org_pk, progress_data.key), _finish_delete.si(None, org_pk, progress_data.key))() return progress_data.result()