Skip to content

Commit

Permalink
test: fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JustARatherRidiculouslyLongUsername committed Nov 25, 2024
1 parent e7e1d1b commit 6a50afe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/test_fyle/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def create_temp_workspace(db):
@pytest.fixture
def update_config_for_split_expense_grouping(db):
def _update_config_for_split_expense_grouping(general_settings, expense_group_settings):
general_settings.corporate_credit_card_expenses_object = 'BANK TRANSACTION'
general_settings.corporate_credit_card_expenses_object = 'CREDIT CARD CHARGE'
general_settings.save()
expense_group_settings.split_expense_grouping = 'SINGLE_LINE_ITEM'
expense_group_settings.corporate_credit_card_expense_group_fields = [
Expand Down
6 changes: 3 additions & 3 deletions tests/test_fyle/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def test_split_expense_grouping_with_no_bank_transaction_id(db, update_config_fo
expense_group_settings.save()

ExpenseGroup.create_expense_groups_by_report_id_fund_source(expense_objects, configuration, workspace_id)
groups = ExpenseGroup.objects.filter(expenses__expense_id__in=[expense['id'] for expense in expenses])
groups = ExpenseGroup.objects.filter(expenses__expense_id__in=[expense['id'] for expense in expenses]).distinct()
assert len(groups) - old_count == 2, f'Expected 2 groups, got {len(groups) - old_count}'


Expand Down Expand Up @@ -201,7 +201,7 @@ def test_split_expense_grouping_with_same_and_different_ids(db, update_config_fo
expense_group_settings.save()

ExpenseGroup.create_expense_groups_by_report_id_fund_source(expense_objects, configuration, workspace_id)
groups = ExpenseGroup.objects.filter(expenses__expense_id__in=[expense['id'] for expense in expenses])
groups = ExpenseGroup.objects.filter(expenses__expense_id__in=[expense['id'] for expense in expenses]).distinct()

assert len(groups) - old_count == 2, f'Expected 2 groups, got {len(groups) - old_count}'

Expand Down Expand Up @@ -240,6 +240,6 @@ def test_split_expense_grouping_pairs_of_same_ids(db, update_config_for_split_ex
expense_group_settings.save()

ExpenseGroup.create_expense_groups_by_report_id_fund_source(expense_objects, configuration, workspace_id)
groups = ExpenseGroup.objects.filter(expenses__expense_id__in=[expense['id'] for expense in expenses])
groups = ExpenseGroup.objects.filter(expenses__expense_id__in=[expense['id'] for expense in expenses]).distinct()

assert len(groups) - old_count== 2, f'Expected 2 groups, got {len(groups) - old_count}'

0 comments on commit 6a50afe

Please sign in to comment.