-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
import Pytest fixtures moved to test_imports
- Loading branch information
Showing
2 changed files
with
96 additions
and
91 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 |
---|---|---|
@@ -0,0 +1,96 @@ | ||
""" | ||
Fixture configuration for import tests | ||
""" | ||
import pytest | ||
|
||
from fyle_accounting_mappings.models import DestinationAttribute | ||
|
||
|
||
@pytest.fixture() | ||
@pytest.mark.django_db(databases=['default']) | ||
def add_project_mappings(): | ||
""" | ||
Pytest fixtue to add project mappings to a workspace | ||
""" | ||
workspace_ids = [ | ||
1, 2, 3 | ||
] | ||
for workspace_id in workspace_ids: | ||
DestinationAttribute.objects.create( | ||
workspace_id=workspace_id, | ||
attribute_type='PROJECT', | ||
display_name='Direct Mail Campaign', | ||
value='Direct Mail Campaign', | ||
destination_id='10064', | ||
detail='Sage 300 Project - Direct Mail Campaign, Id - 10064', | ||
active=True | ||
) | ||
DestinationAttribute.objects.create( | ||
workspace_id=workspace_id, | ||
attribute_type='PROJECT', | ||
display_name='Platform APIs', | ||
value='Platform APIs', | ||
destination_id='10081', | ||
detail='Sage 300 Project - Platform APIs, Id - 10081', | ||
active=True | ||
) | ||
|
||
|
||
@pytest.fixture() | ||
@pytest.mark.django_db(databases=['default']) | ||
def add_cost_center_mappings(): | ||
""" | ||
Pytest fixtue to add cost center mappings to a workspace | ||
""" | ||
workspace_ids = [ | ||
1, 2, 3 | ||
] | ||
for workspace_id in workspace_ids: | ||
DestinationAttribute.objects.create( | ||
workspace_id=workspace_id, | ||
attribute_type='COST_CENTER', | ||
display_name='Direct Mail Campaign', | ||
value='Direct Mail Campaign', | ||
destination_id='10064', | ||
detail='Cost Center - Direct Mail Campaign, Id - 10064', | ||
active=True | ||
) | ||
DestinationAttribute.objects.create( | ||
workspace_id=workspace_id, | ||
attribute_type='COST_CENTER', | ||
display_name='Platform APIs', | ||
value='Platform APIs', | ||
destination_id='10081', | ||
detail='Cost Center - Platform APIs, Id - 10081', | ||
active=True | ||
) | ||
|
||
|
||
@pytest.fixture() | ||
@pytest.mark.django_db(databases=['default']) | ||
def add_merchant_mappings(): | ||
""" | ||
Pytest fixture to add merchant mappings to a workspace | ||
""" | ||
workspace_ids = [ | ||
1, 2, 3 | ||
] | ||
for workspace_id in workspace_ids: | ||
DestinationAttribute.objects.create( | ||
workspace_id=workspace_id, | ||
attribute_type='MERCHANT', | ||
display_name='Direct Mail Campaign', | ||
value='Direct Mail Campaign', | ||
destination_id='10064', | ||
detail='Merchant - Direct Mail Campaign, Id - 10064', | ||
active=True | ||
) | ||
DestinationAttribute.objects.create( | ||
workspace_id=workspace_id, | ||
attribute_type='MERCHANT', | ||
display_name='Platform APIs', | ||
value='Platform APIs', | ||
destination_id='10081', | ||
detail='Merchant - Platform APIs, Id - 10081', | ||
active=True | ||
) |