mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 14:31:57 -05:00
Update schema to allow include_jobs on get_notis
This commit is contained in:
@@ -5,6 +5,7 @@ from flask import json
|
||||
from freezegun import freeze_time
|
||||
from jsonschema import ValidationError
|
||||
|
||||
from app.models import NOTIFICATION_CREATED, EMAIL_TYPE
|
||||
from app.schema_validation import validate
|
||||
from app.v2.notifications.notification_schemas import (
|
||||
get_notifications_request,
|
||||
@@ -13,6 +14,22 @@ from app.v2.notifications.notification_schemas import (
|
||||
)
|
||||
|
||||
|
||||
valid_get_json = {}
|
||||
|
||||
valid_get_with_optionals_json = {
|
||||
"reference": "test reference",
|
||||
"status": [NOTIFICATION_CREATED],
|
||||
"template_type": [EMAIL_TYPE],
|
||||
"include_jobs": "true",
|
||||
"older_than": "a5149c32-f03b-4711-af49-ad6993797d45"
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.parametrize("input", [valid_get_json, valid_get_with_optionals_json])
|
||||
def test_get_notifications_valid_json(input):
|
||||
assert validate(input, get_notifications_request) == input
|
||||
|
||||
|
||||
@pytest.mark.parametrize('invalid_statuses, valid_statuses', [
|
||||
# one invalid status
|
||||
(["elephant"], []),
|
||||
|
||||
Reference in New Issue
Block a user