-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
birthdate format fix / preferred field typo fix #84
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
58246c3
birthdate format fix / preferred field typo fix
kialj876 166c409
postman example update
kialj876 870cd38
postman example update 2
kialj876 b51b883
prevent coverage from failing pytest CI step as it runs afterwards in…
kialj876 c5cb19a
coverage ci flow fix
kialj876 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,3 @@ filterwarnings = | |
markers = | ||
slow | ||
serial | ||
|
||
[coverage:report] | ||
fail_under=80 |
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 |
---|---|---|
|
@@ -213,23 +213,23 @@ | |
}, | ||
{ | ||
"key": "Date", | ||
"value": "Wed, 13 Dec 2023 21:40:11 GMT" | ||
"value": "Fri, 15 Dec 2023 18:21:32 GMT" | ||
}, | ||
{ | ||
"key": "Content-Type", | ||
"value": "application/json" | ||
}, | ||
{ | ||
"key": "Content-Length", | ||
"value": "907" | ||
"value": "888" | ||
}, | ||
{ | ||
"key": "Connection", | ||
"value": "close" | ||
} | ||
], | ||
"cookie": [], | ||
"body": "[\n {\n \"controlType\": {\n \"directors\": {\n \"directControl\": true,\n \"inConcertControl\": true,\n \"indirectControl\": true,\n \"significantInfluence\": false\n },\n \"other\": \"\",\n \"sharesVotes\": {\n \"beneficialOwner\": false,\n \"inConcertControl\": true,\n \"indirectControl\": false,\n \"registeredOwner\": true\n }\n },\n \"endDate\": null,\n \"missingInfoReason\": null,\n \"percentOfShares\": 20,\n \"percentOfVotes\": 10,\n \"profile\": {\n \"address\": {\n \"city\": \"Vancouver\",\n \"country\": {\n \"alpha_2\": \"CA\",\n \"name\": \"Canada\"\n },\n \"line1\": \"111 test street\",\n \"line2\": null,\n \"postalCode\": \"V0E 1H5\",\n \"region\": \"BC\"\n },\n \"birthDate\": \"Sun, 19 Mar 2000 00:00:00 GMT\",\n \"citizenshipCA\": \"citizen\",\n \"citizenshipsExCa\": null,\n \"competency\": {\n \"decisionMaking\": true,\n \"financialAffairs\": true\n },\n \"email\": \"[email protected]\",\n \"fullName\": \"John Smith\",\n \"hasTaxNumber\": true,\n \"isTaxResident\": true,\n \"prefferedName\": null,\n \"taxNumber\": \"000 000 000\",\n \"uuid\": \"14d7608b-7d04-4a72-bca7-57cf713206f1\"\n },\n \"startDate\": \"2020-04-21\",\n \"uuid\": \"4ea1e7f1-6333-498f-b4a5-217032342cf7\"\n }\n]" | ||
"body": "[\n {\n \"controlType\": {\n \"directors\": {\n \"directControl\": true,\n \"inConcertControl\": true,\n \"indirectControl\": true,\n \"significantInfluence\": false\n },\n \"other\": \"\",\n \"sharesVotes\": {\n \"beneficialOwner\": false,\n \"inConcertControl\": true,\n \"indirectControl\": false,\n \"registeredOwner\": true\n }\n },\n \"endDate\": null,\n \"missingInfoReason\": null,\n \"percentOfShares\": 20,\n \"percentOfVotes\": 10,\n \"profile\": {\n \"address\": {\n \"city\": \"Vancouver\",\n \"country\": {\n \"alpha_2\": \"CA\",\n \"name\": \"Canada\"\n },\n \"line1\": \"111 test street\",\n \"line2\": null,\n \"postalCode\": \"V0E 1H5\",\n \"region\": \"BC\"\n },\n \"birthDate\": \"2000-03-19\",\n \"citizenshipCA\": \"citizen\",\n \"citizenshipsExCa\": null,\n \"competency\": {\n \"decisionMaking\": true,\n \"financialAffairs\": true\n },\n \"email\": \"[email protected]\",\n \"fullName\": \"John Smith\",\n \"hasTaxNumber\": true,\n \"isTaxResident\": true,\n \"preferredName\": \"John\",\n \"taxNumber\": \"000 000 000\",\n \"uuid\": \"1ff28004-894e-43dc-af03-86aeb925d95e\"\n },\n \"startDate\": \"2020-04-21\",\n \"uuid\": \"482564ad-311e-4b48-85d3-d1199d2dc6b1\"\n }\n]" | ||
} | ||
] | ||
} | ||
|
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 |
---|---|---|
|
@@ -2,17 +2,16 @@ | |
""" | ||
import pytest | ||
|
||
from btr_api.models import Person | ||
from btr_api.services.person import PersonSerializer, PersonService | ||
|
||
from tests.unit import nested_session | ||
|
||
person_example = { | ||
'fullName': 'This is persons full name', | ||
'familyName': None, | ||
'givenName': None, | ||
'patronymicName': None, | ||
'birthDate': '1980-01-01' | ||
'preferredName': 'Preferred Name', | ||
'email': '[email protected]', | ||
'birthDate': '1980-01-01', | ||
'taxNumber': '000 000 000' | ||
} | ||
|
||
owner_dict = { | ||
|
@@ -26,7 +25,8 @@ | |
("test ownership_details dic is converted to model", person_example), | ||
], | ||
) | ||
def test_convert_dict_to_model(client, session, test_name, person_details_dict): | ||
def test_convert_dict_to_model(session, test_name, person_details_dict): | ||
"""Assure the from_dict serializer works as expected.""" | ||
with nested_session(session): | ||
model = PersonSerializer.from_dict(person_details_dict) | ||
|
||
|
@@ -42,13 +42,26 @@ def test_convert_dict_to_model(client, session, test_name, person_details_dict): | |
assert model.created_at is not None | ||
|
||
|
||
@pytest.mark.parametrize("test_name, person_details_dict", [ | ||
("basic", person_example), | ||
]) | ||
def test_convert_model_to_dict(client, session, test_name, person_details_dict): | ||
"""Assure the to_dict serializer works as expected.""" | ||
with nested_session(session): | ||
model = PersonSerializer.from_dict(person_details_dict) | ||
model.save() | ||
model_dict = PersonSerializer.to_dict(model) | ||
for key in person_details_dict: | ||
assert person_details_dict[key] == model_dict[key] | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"test_name, submission_details_dict", | ||
[ | ||
("test ownership_details dic is converted to model", owner_dict), | ||
], | ||
) | ||
def test_create_model_from_json(session, test_name, submission_details_dict): | ||
def test_create_model_from_owner(session, test_name, submission_details_dict): | ||
"""Assure the create person method works as expected.""" | ||
with nested_session(session): | ||
person = PersonService.create_person_from_owner(owner_dict) | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldnt we b e using dates in ISO format ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep you're right -- think I just need to run the example again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh wait nvm this is just in the header value (automatic from postman)