Commit Graph
19 Commits
Author SHA1 Message Date
alexjanousekGSA c1507ec060 Fixed some linting errors 2025-05-16 14:14:50 -04:00
alexjanousekGSA a100fa6eb8 Fixed test_get_notification.py tests 2025-05-14 15:01:01 -04:00
Kenneth Kehl 22ffc56520 remove v2 2024-05-30 12:27:07 -07:00
Kenneth Kehl b777249b6f merge from main 2024-03-01 13:50:09 -08:00
Cliff Hill 8c6046b03b Cleaning up tests.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2024-02-28 12:43:33 -05:00
Kenneth Kehl 6dc9828663 fix tests 2024-01-22 10:55:09 -08:00
Kenneth Kehl f9f1013f5b notify-api-742 don't write phone numbers to db 2024-01-16 11:21:24 -08:00
Kenneth Kehl 1ecb747c6d reformat 2023-08-29 14:54:30 -07:00
Ben Thorner 0312e2a528 Split generating authorization headers by type
In response to [1].

[1]: https://github.com/alphagov/notifications-api/pull/3300#discussion_r681653248
2021-08-04 15:13:52 +01:00
Ben Thorner a91fde2fda Run auto-correct on app/ and tests/ 2021-03-12 11:45:45 +00:00
Paul Craig ffb813bb3f Add get_notifications json schema + tests
Add a schema that corresponds to our response for returning lists
of notifications, and test with a contract test.
2016-11-25 16:50:20 +00:00
Paul Craig ebfac180c0 Add contract test for 'v2' email notification
We don't have a way of creating letter notifications just yet, so
this is all we can test.
2016-11-22 13:40:55 +00:00
Paul Craig 7ae427c4ef Use jsonschema validation + remove 'v2' schema
Emualated the validation methods that exist [in the python-client](https://github.com/alphagov/notifications-python-client/blob/620e5f7014e4a431a7192cd617315e56b26c912f/integration_test/__init__.py).

The `validate_v0` function loads json schemas from a local
`/schemas` directory, whereas the new `validate` function (which
we're going to use for our v2 API calls) uses the common
`get_notification_response` python schema defined in
"app/v2/notifications/notification_schemas.py".

Removed the new `v2` schema from the last commit as it's no longer
being used.

Also, refactored common code in the GET and POST contract files
so that making requests and converting responses to JSON are
pulled out into common functions.
2016-11-22 13:40:22 +00:00
Paul Craig fb50bb6325 Add 'v2' notification schema to contract tests
Converted python-based schema in
"app/v2/notifications/notification_schema.py" into a pure json
schema and tested it with the new "v2/" API route to confirm that
it validates.

Also refactored some common code in the public contract GET tests
that returns notifications.
2016-11-22 12:07:05 +00:00
Leo Hemsted c91358673f add POST response tests
assert that the response for emails and sms is formatted as expected

also moved schemas into subdirectory to make folder more legible
2016-08-31 12:33:45 +01:00
Leo Hemsted fabbb8b01b separate tests for api and job notifications 2016-08-31 11:53:54 +01:00
Leo Hemsted cb0491cbff add test for GET /notification
simple schema with oneOf [email, sms].
also fixed error where ref'd schemas weren't being picked up
2016-08-30 19:07:46 +01:00
Leo Hemsted 1b7b4a2ccb separate definitions into separate files to allow reuse
see https://github.com/Julian/jsonschema/issues/98

took boring generic things (eg uuid) into definitions.json, and also
separated email and sms notification objects into respective files
2016-08-30 18:45:54 +01:00
Leo Hemsted aebaea1072 add public contract tests
use jsonschema to test the GET /notification/{} endpoint to highlight any key name/format/type changes
2016-08-30 15:55:52 +01:00