Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
anishfyle committed Aug 5, 2024
1 parent 08c9bfc commit c384240
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 6 additions & 2 deletions apps/mappings/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ def sync_projects(self, source_type: str):
'order': 'updated_at.desc'
}
projects_generator = self.platform.v1beta.admin.projects.list_all(query)
existing_projects = QBDMapping.objects.filter(workspace_id=self.workspace_id, attribute_type=source_type).values_list('source_value', flat=True)
existing_projects = QBDMapping.objects.filter(
workspace_id=self.workspace_id,
attribute_type=source_type).values_list('source_value', flat=True)

source_attributes = []

Expand Down Expand Up @@ -140,7 +142,9 @@ def sync_cost_center(self, source_type: str):
}

cost_center_generator = self.platform.v1beta.admin.cost_centers.list_all(query)
existing_cost_centers = QBDMapping.objects.filter(workspace_id=self.workspace_id, attribute_type=source_type).values_list('source_value', flat=True)
existing_cost_centers = QBDMapping.objects.filter(
workspace_id=self.workspace_id,
attribute_type=source_type).values_list('source_value', flat=True)

source_attributes = []

Expand Down
1 change: 0 additions & 1 deletion tests/test_mapping/test_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ def test_sync_cost_center(create_temp_workspace, add_fyle_credentials, mocker):
qbd_mappings = QBDMapping.objects.filter(workspace_id=workspace_id, attribute_type=source_type)
assert len(qbd_mappings) == len(mock_response[0]['data'])
for i, mapping in enumerate(qbd_mappings):
cost_center = mock_response[0]['data'][i]
assert mapping.source_value == 'Cost Center 1'


Expand Down

0 comments on commit c384240

Please sign in to comment.