Skip to content

Commit

Permalink
feat: disable items - category (#667)
Browse files Browse the repository at this point in the history
* disable/enable items

* update submodule

* update submodule

* update submodule

* add tests for cov
  • Loading branch information
Hrishabh17 committed Sep 30, 2024
1 parent b998c57 commit b36a4c9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 4 additions & 2 deletions apps/mappings/queues.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,10 @@ def construct_tasks_and_chain_import_fields_to_fyle(workspace_id):
'is_3d_mapping': False,
}

if not workspace_general_settings.import_items:
task_settings['import_items'] = False
# if not workspace_general_settings.import_items:
# task_settings['import_items'] = False

task_settings['import_items'] = workspace_general_settings.import_items

# For now we are only adding PROJECTS support that is why we are hardcoding it
if mapping_settings:
Expand Down
6 changes: 5 additions & 1 deletion tests/test_fyle/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from apps.workspaces.models import FyleCredential, Workspace, WorkspaceGeneralSettings
from tests.helper import dict_compare_keys
from tests.test_fyle.fixtures import data
from fyle.platform.exceptions import InternalServerError, InvalidTokenError
from fyle.platform.exceptions import InternalServerError, InvalidTokenError, RetryException


@pytest.mark.django_db()
Expand All @@ -40,6 +40,10 @@ def test_create_expense_groups(mocker, db):

assert task_log.status == 'COMPLETE'

mock_platform = mocker.patch('apps.fyle.tasks.PlatformConnector')
mock_platform.side_effect = RetryException('Retry Exception')
create_expense_groups(1, ['PERSONAL', 'CCC'], task_log)

fyle_credential = FyleCredential.objects.get(workspace_id=1)
fyle_credential.delete()
task_log, _ = TaskLog.objects.update_or_create(workspace_id=1, type='FETCHING_EXPENSES', defaults={'status': 'IN_PROGRESS'})
Expand Down

0 comments on commit b36a4c9

Please sign in to comment.