Skip to content

Commit

Permalink
test fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashutosh619-sudo committed Nov 22, 2024
1 parent c2ecbed commit a028652
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
2 changes: 0 additions & 2 deletions apps/business_central/exports/journal_entry/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ def create_or_update_object(self, accounting_export: AccountingExport, _: Advanc

advance_setting = AdvancedSetting.objects.get(workspace_id=accounting_export.workspace_id)

print(accounting_export.__dict__)

document_number = expense.expense_number

comment = self.get_expense_comment(accounting_export.workspace_id, expense, expense.category, advance_setting)
Expand Down
2 changes: 0 additions & 2 deletions apps/business_central/exports/purchase_invoice/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ def __construct_purchase_invoice(self, body: PurchaseInvoice, lineitems: List[Pu
for dimension in lineitem.dimensions:
dimension['exported_module_id'] = lineitem.id

print('lineitem.dimensions', lineitem.dimensions)

dimensions.extend(lineitem.dimensions)
purchase_invoice_lineitem_payload = {
"lineType": "Account",
Expand Down
3 changes: 2 additions & 1 deletion tests/test_business_central/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ def create_journal_entry(
create_export_settings,
add_advanced_settings,
create_accounting_export_expenses,
create_employee_mapping_with_employee
create_employee_mapping_with_employee,
add_fyle_credentials
):
workspace_id = 1
export_settings = ExportSetting.objects.get(workspace_id=workspace_id)
Expand Down
12 changes: 8 additions & 4 deletions tests/test_business_central/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ def test_create_or_update_journal_entry_1(
create_export_settings,
add_advanced_settings,
create_accounting_export_expenses,
create_employee_mapping_with_employee
create_employee_mapping_with_employee,
add_fyle_credentials
):
workspace_id = 1
export_settings = ExportSetting.objects.get(workspace_id=workspace_id)
Expand All @@ -39,7 +40,8 @@ def test_create_or_update_journal_entry_2(
create_export_settings,
add_advanced_settings,
create_accounting_export_expenses,
create_employee_mapping_with_vendor
create_employee_mapping_with_vendor,
add_fyle_credentials
):
workspace_id = 1
export_settings = ExportSetting.objects.get(workspace_id=workspace_id)
Expand Down Expand Up @@ -75,7 +77,8 @@ def test_create_or_update_journal_entry_3(
create_export_settings,
add_advanced_settings,
create_accounting_export_expenses,
create_employee_mapping_with_vendor
create_employee_mapping_with_vendor,
add_fyle_credentials
):
workspace_id = 1
export_settings = ExportSetting.objects.get(workspace_id=workspace_id)
Expand Down Expand Up @@ -324,7 +327,8 @@ def test_accounting_data_exporter_4(
def test_base_model_get_invoice_date(
db,
create_temp_workspace,
create_journal_entry
create_journal_entry,
add_fyle_credentials
):
workspace_id = 1

Expand Down
10 changes: 8 additions & 2 deletions tests/test_business_central/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
from apps.business_central.exports.journal_entry.tasks import create_journal_entry
from apps.business_central.exports.purchase_invoice.tasks import create_purchase_invoice

import logging

logger = logging.getLogger(__name__)
logger.level = logging.INFO


def test_trigger_export_journal_entry(db, mocker):
'''
Expand Down Expand Up @@ -36,8 +41,9 @@ def test_construct_journal_entry(
lineitems = JournalEntryLineItems.objects.filter(workspace_id=workspace_id)

export_journal_entry = ExportJournalEntry()
payload_list = export_journal_entry._ExportJournalEntry__construct_journal_entry(journal_entry, lineitems)
payload_list, _ = export_journal_entry._ExportJournalEntry__construct_journal_entry(journal_entry, lineitems)

logger.info(payload_list)
assert len(payload_list) > 0
payload = payload_list[0]

Expand Down Expand Up @@ -159,7 +165,7 @@ def test_construct_purchase_invoice(
lineitems = PurchaseInvoiceLineitems.objects.filter(workspace_id=workspace_id)

export_purchase_invoice = ExportPurchaseInvoice()
payload, batch_payload = export_purchase_invoice.\
payload, batch_payload, _ = export_purchase_invoice.\
_ExportPurchaseInvoice__construct_purchase_invoice(
purchase_invoice,
lineitems
Expand Down

0 comments on commit a028652

Please sign in to comment.