-
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.
* Job, Dep Field code-prepending support * auto map feature * fix comments - add util func, handle code in VENDOR_TYPE * fix existing test cases * Add check for syncing jobs, deps and add test cases * update func name * added unit tests * fix failing test * add project import related test cases * fix lint * remove redundant db calls * add support for code prepending in CATEGORY * add support for code prepending in MERCHANT * change the callback methods are sent * bug fix * add support for code prepending in COST_CENTER * rename helper func, fix is_job_sync_allowed method * rename the helper method * rename the helper method * rename the helper method * fix callback method mapping of vendor * rename the helper method * add support for code prepending in CUSTOM attribute * improve test case * add test cases * method refactor
- Loading branch information
1 parent
4c99385
commit 253cb2b
Showing
8 changed files
with
230 additions
and
23 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
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
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
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,47 @@ | ||
from django.urls import reverse | ||
from rest_framework import status | ||
from tests.test_mappings.fixtures import data | ||
from tests.helper import dict_compare_keys | ||
|
||
|
||
def test_paginated_destination_attributes_view(db, api_client, test_connection, create_temp_workspace, add_project_mappings): | ||
""" | ||
Test paginated destination attributes view | ||
""" | ||
workspace_id = 1 | ||
# url = f'/api/workspaces/{workspace_id}/mappings/paginated_destination_attributes/?limit=100&offset=0&attribute_type={attribute_type}&active=true&value={value}' | ||
|
||
url = reverse('paginated_destination_attributes_view', args=[workspace_id]) | ||
|
||
# Test with no value matching the data | ||
params = { | ||
'limit': 100, | ||
'offset': 0, | ||
'attribute_type': 'JOB', | ||
'active': 'true', | ||
'value': 'Something not in the data' | ||
} | ||
|
||
api_client.credentials(HTTP_AUTHORIZATION='Bearer {}'.format(test_connection.access_token)) | ||
|
||
response = api_client.get(url, params) | ||
assert response.status_code == status.HTTP_200_OK | ||
assert dict_compare_keys(response.json(), data['paginated_destination_attributes_view_response_1']) == [], 'paginated destination attributes view api return diffs in keys' | ||
|
||
# Test with value (code) in the data | ||
params.update(value='123') | ||
|
||
api_client.credentials(HTTP_AUTHORIZATION='Bearer {}'.format(test_connection.access_token)) | ||
|
||
response = api_client.get(url, params) | ||
assert response.status_code == status.HTTP_200_OK | ||
assert dict_compare_keys(response.json(), data['paginated_destination_attributes_view_response_2']) == [], 'paginated destination attributes view api return diffs in keys' | ||
|
||
# Test with value (name) in the data | ||
params.update(value='cre') | ||
|
||
api_client.credentials(HTTP_AUTHORIZATION='Bearer {}'.format(test_connection.access_token)) | ||
|
||
response = api_client.get(url, params) | ||
assert response.status_code == status.HTTP_200_OK | ||
assert dict_compare_keys(response.json(), data['paginated_destination_attributes_view_response_2']) == [], 'paginated destination attributes view api return diffs in keys' |
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