-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ashutosh619-sudo
committed
Nov 8, 2023
1 parent
0a4aee3
commit 469efda
Showing
3 changed files
with
72 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,37 @@ | |
from django_q.models import Schedule | ||
from apps.workspaces.models import Configuration, Workspace | ||
from apps.mappings.models import GeneralMapping | ||
from fyle_accounting_mappings.models import MappingSetting, ExpenseAttribute | ||
from apps.tasks.models import Error | ||
from fyle_accounting_mappings.models import MappingSetting, ExpenseAttribute, EmployeeMapping | ||
|
||
|
||
@pytest.mark.django_db() | ||
def test_resolve_post_employees_mapping_errors(access_token): | ||
source_employee = ExpenseAttribute.objects.filter( | ||
value='[email protected]', | ||
workspace_id=1, | ||
attribute_type='EMPLOYEE' | ||
).first() | ||
|
||
Error.objects.update_or_create( | ||
workspace_id=1, | ||
expense_attribute=source_employee, | ||
defaults={ | ||
'type': 'EMPLOYEE_MAPPING', | ||
'error_title': source_employee.value, | ||
'error_detail': 'Employee mapping is missing', | ||
'is_resolved': False | ||
} | ||
) | ||
employee_mapping, _ = EmployeeMapping.objects.update_or_create( | ||
source_employee_id=1, | ||
destination_employee_id=719, | ||
workspace_id=1 | ||
) | ||
|
||
error = Error.objects.filter(expense_attribute_id=employee_mapping.source_employee_id).first() | ||
|
||
assert error.is_resolved == True | ||
|
||
@pytest.mark.django_db() | ||
def test_run_post_mapping_settings_triggers(access_token): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters