generated from bcgov/bcrs-template-ui
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
15050 consent continuation out (#126)
* 15050 consent continuation out * common schema for registrars order, registrars notation and consent continuation out
- Loading branch information
1 parent
f70aef8
commit 33d2c93
Showing
8 changed files
with
125 additions
and
32 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
29 changes: 29 additions & 0 deletions
29
src/registry_schemas/schemas/consent_continuation_out.json
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,29 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "https://bcrs.gov.bc.ca/.well_known/schemas/consent_continuation_out", | ||
"title": "Consent Continuation Out Schema", | ||
"definitions": {}, | ||
"required": [ | ||
"consentContinuationOut" | ||
], | ||
"type": "object", | ||
"properties": { | ||
"consentContinuationOut": { | ||
"type": "object", | ||
"required": [ | ||
"details" | ||
], | ||
"properties": { | ||
"details": { | ||
"type": "string", | ||
"minLength": 1, | ||
"maxLength": 2000, | ||
"description": "A brief note to explain the consent to continue out." | ||
}, | ||
"courtOrder": { | ||
"$ref": "https://bcrs.gov.bc.ca/.well_known/schemas/court_order#/properties/courtOrder" | ||
} | ||
} | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -23,4 +23,4 @@ | |
""" | ||
|
||
|
||
__version__ = '2.17.0' # pylint: disable=invalid-name | ||
__version__ = '2.18.0' # pylint: disable=invalid-name |
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,48 @@ | ||
# Copyright © 2023 Province of British Columbia | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
"""Test Suite to ensure consent continuation out schemas are valid.""" | ||
|
||
import copy | ||
|
||
from registry_schemas import validate | ||
from registry_schemas.example_data import CONSENT_CONTINUATION_OUT | ||
|
||
|
||
def test_consent_continuation_out_schema(): | ||
"""Assert that the JSONSchema validator is working.""" | ||
legal_filing = {'consentContinuationOut': copy.deepcopy(CONSENT_CONTINUATION_OUT)} | ||
|
||
is_valid, errors = validate(legal_filing, 'consent_continuation_out') | ||
|
||
if errors: | ||
for err in errors: | ||
print(err.message) | ||
print(errors) | ||
|
||
assert is_valid | ||
|
||
|
||
def test_consent_continuation_out_invalid_schema(): | ||
"""Assert that the JSONSchema validator is working.""" | ||
legal_filing = {'consentContinuationOut': copy.deepcopy(CONSENT_CONTINUATION_OUT)} | ||
legal_filing['consentContinuationOut']['details'] = '' | ||
|
||
is_valid, errors = validate(legal_filing, 'consent_continuation_out') | ||
|
||
if errors: | ||
for err in errors: | ||
print(err.message) | ||
print(errors) | ||
|
||
assert not is_valid |
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