Commit Graph

16 Commits

Author SHA1 Message Date
Kenneth Kehl
1ecb747c6d reformat 2023-08-29 14:54:30 -07:00
jimmoffet
434b7b2d08 clean up and remove redundancy 2022-10-04 16:01:30 -07:00
Katie Smith
8ae2b0bb31 Replace how .dump is called
As with `.load`, only data is now returned instead of a tuple.
2022-05-25 11:35:44 +01:00
Katie Smith
bd4f74b359 Replace how .load is called
https://marshmallow.readthedocs.io/en/stable/upgrading.html#schemas-are-always-strict

`.load` doesn't return a `(data, errors)` tuple any more - only data is
returned. A `ValidationError` is raised if validation fails. The code
now relies on the `marshmallow_validation_error` error handler to handle
errors instead of having to raise an `InvalidRequest`. This has no
effect on the response that is returned (a test has been modified to
check).

Also added a new `password` field to the `UserSchema` so that we don't
have to specially check for password errors in the `.create_user` endpoint
- we can let marshmallow handle them.
2022-05-25 11:35:44 +01:00
Ben Thorner
a91fde2fda Run auto-correct on app/ and tests/ 2021-03-12 11:45:45 +00:00
Leo Hemsted
42e6bd8b82 remove unused old file 2019-12-13 10:02:39 +00:00
Leo Hemsted
4a6a228cc2 clear up where we use restore_provider_details
it now only needs to be used when you're:
* updating providers in ways that will create history (eg through
  regular api calls)
* altering more than just priority in test setup (eg setting inactive,
  deleting, or adding a provider)
2019-11-28 13:29:02 +00:00
Katie Smith
62735ea125 Remove sample_notification_with_api_key fixture
This was only used once and was not Pytest 4 compatible.
2019-09-18 11:04:24 +01:00
Imdad Ahad
44c5831f3d Remove old status schema references 2017-07-10 15:50:57 +01:00
Leo Hemsted
466c833c39 marshmallow schemas no longer return _status_enum column
now return `status`, as they should
2017-05-10 17:30:09 +01:00
Imdad Ahad
ed8dcf5fa1 Refactor schemas and add tests to ensure user is returned on provider schema
dump
2017-03-09 08:43:44 +00:00
Imdad Ahad
f85ee54707 Refactor stuff + stricter validation for updating only ALLOWED user attrs 2016-11-10 13:09:25 +00:00
Imdad Ahad
8a126c7387 Add a schema to validate a single user attr 'strictly' 2016-11-07 17:41:49 +00:00
Chris Hill-Scott
130f42fed2 Add details of API key to notifications
We want to show developers a log of notifications they’ve sent using the
API in the admin app. In order to indentify a notification it’s probably
helpful to know:

- who the notification was sent to (which we expose)
- when the notification was created (which we expose)
- which key was used to create the notification (which we expose, but
  only as the `id` of the key)

Developers don’t see the `id` of the API key in the app anywhere, so
this isn’t useful information. Much more useful is the `type` and `name`
of the key. So this commit changes the schema to also return these.

This commit does some slightly hacky stuff with conftest because it
breaks a lot of other tests if the sample notification has a real API
key or an API key with a non-unique name.
2016-09-23 14:44:15 +01:00
Martyn Inglis
803820d9aa New field on GET /notifications to allow users to request CSV data 2016-09-15 15:59:34 +01:00
Leo Hemsted
edc72a57ca add test file for schemas 2016-06-10 16:34:20 +01:00