Leo Hemsted
7240df0641
replace mock with unittest.mock
2016-08-31 12:39:11 +01: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
Leo Hemsted
b21c8de9a3
add new sample_email_notification fixture
...
dont include any of the parameters for now - only add em when we have an actual need for them
2016-08-30 15:55:27 +01:00
Leo Hemsted
59346d7546
add new client fixture
...
replaces previous notify_api fixture with the age old:
```
with notify_api.test_request_context():
with notify_api.test_client() as client:
```
just runs those two context managers in a yield fixture (new pytest 3.0 feature)
2016-08-30 15:55:27 +01:00
Leo Hemsted
fa3d4413e7
update test requirements
...
requirements should be kept up to date to ensure we get bug fixes and new features as they come - particularly py.test, which we were running an 18 month old version for, and missing out on some useful xfail and fixture enhancements, among other things
2016-08-30 15:55:23 +01:00
Leo Hemsted
4f0c5fdd9e
Merge pull request #623 from alphagov/test-fixes
...
Test fixes
2016-08-30 10:38:53 +01:00
minglis
287d32c037
Merge pull request #638 from alphagov/remove-contested-writes
...
Remove contested writes
2016-08-30 08:56:45 +01:00
minglis
1834522824
Merge pull request #642 from alphagov/remove-travis
...
Remove travis builds
2016-08-26 15:58:14 +01:00
Martyn Inglis
929486ae46
Remove travis builds
2016-08-26 15:33:49 +01:00
Chris Hill-Scott
f09704e5f4
Merge pull request #624 from alphagov/sms-sender-no-prefix
...
Don’t prefix text messages if sender name is set
2016-08-26 14:57:12 +01:00
Chris Hill-Scott
f7391da350
Don’t prefix text messages is sender name is set
...
Implements:
- [x] https://github.com/alphagov/notifications-utils/pull/66
2016-08-26 14:45:01 +01:00
Leo Hemsted
7835339165
Merge branch 'master' into test-fixes
2016-08-26 10:57:41 +01:00
Andras Ferencz-Szabo
5c0185704e
Merge pull request #639 from alphagov/travis_cleanup
...
Travis cleanup: remove deploy + functest trigger
2016-08-25 16:26:35 +01:00
bandesz
9b4188f05a
Travis cleanup: remove deploy + functest trigger
2016-08-25 16:19:52 +01:00
Martyn Inglis
6e7532a561
Removed unused imports
2016-08-25 15:41:37 +01:00
Martyn Inglis
05abd15026
Merge branch 'master' into remove-contested-writes
2016-08-25 14:38:04 +01:00
Martyn Inglis
5012d20d58
Merge branch 'master' into remove-contested-writes
2016-08-25 14:37:51 +01:00
Leo Hemsted
d89e9e9930
Merge pull request #628 from alphagov/notification-statistics
...
Platform admin notification query
2016-08-25 14:37:46 +01:00
minglis
2d2ceba2d1
Merge pull request #631 from alphagov/add-new-column-to-jobs-for-delayed-sending
...
Adds new job_status table and FK to jobs.
2016-08-25 12:59:16 +01:00
minglis
415f2416cf
Merge pull request #627 from alphagov/update-job-page-query-2
...
Returns the outcome statistics for the job on the API call.
2016-08-25 12:07:20 +01:00
Martyn Inglis
893164ae40
Removed contented updates the notifications stats table
...
- As before this is now driven from the notifications history table
- Removed from updates and create
- Signatures changes to removed unused params hits many files
- Also potential issue around rate limiting - we used to get the number sent per day from the stats table - which was a single row lookup, now we have to count this. This applies to EVERY API CALL. Probably not a good thing and should be addressed urgently.
2016-08-25 11:55:38 +01:00
Martyn Inglis
708f566c24
Removed updates to the provider stats table
...
- again these new come from the notifications history table
- We update this when we sent a notification, so removed from celery tasks
- tests removed also
2016-08-25 10:33:12 +01:00
Martyn Inglis
84ea173ced
Removed updates to templates statistics
...
- on create notification we updated the templates stats to record the usage.
- this is now based on notification history
- this update and associated tests are now removed,
2016-08-25 10:12:39 +01:00
Martyn Inglis
44bc071037
Removed the updates to the job table to track delivery of notifications
...
Previously we kept a running total of job progress/success/failure on the job table. This causes contention, we now generate this data from notification history.
Removed these updates.
2016-08-25 09:29:53 +01:00
Andras Ferencz-Szabo
020d998baa
Merge pull request #634 from alphagov/env_rename
...
Rename development env to preview
2016-08-24 15:59:51 +01:00
bandesz
135ac6f23e
Rename development env to preview
2016-08-24 15:55:29 +01:00
Leo Hemsted
556b69a487
still return service if they have never sent any notifications
2016-08-24 15:00:51 +01:00
Leo Hemsted
29df7edaf9
tests for detailed services
2016-08-24 15:00:51 +01:00
Leo Hemsted
2053ebd933
rename service to service_blueprint
...
it was causing a bug where a local variable service was not being
instantiated and we were trying to operate on the blueprint instead
it's being used in so few places it makes sense to rename it
2016-08-24 15:00:51 +01:00
Leo Hemsted
00d19f63f0
group results by service using itertools
...
allows us to nicely reuse the existing format_statistics function
2016-08-24 15:00:51 +01:00
Leo Hemsted
ebb13a1251
create initial stats query
...
get statistics for all services, for today only
2016-08-24 15:00:51 +01:00
Leo Hemsted
a9f51f5b48
Merge pull request #603 from alphagov/noti-stats-cleanup
...
Remove some unused code
2016-08-24 14:40:47 +01:00
Leo Hemsted
a3fe1dff1f
include section on testing in readme.md
2016-08-24 14:30:46 +01:00
Leo Hemsted
1e8ab35976
Merge branch 'master' into noti-stats-cleanup
2016-08-24 14:24:17 +01:00
Martyn Inglis
1e10c0485c
Removed some code
2016-08-24 14:05:54 +01:00
Martyn Inglis
805da23d6b
Starting to implement scheduling
2016-08-24 14:04:52 +01:00
Martyn Inglis
5adecda41e
Adds new job_status table and FK to jobs.
...
This will replace the job_status enum type.
2016-08-24 13:34:42 +01:00
minglis
cf14c97ebb
Merge pull request #618 from alphagov/template_useage_per_id
...
Template useage per
2016-08-24 11:01:17 +01:00
Martyn Inglis
3006c7af54
Removed print
2016-08-24 10:59:33 +01:00
Martyn Inglis
acf3c568db
Tidied up the query indentation
2016-08-24 10:50:29 +01:00
Andras Ferencz-Szabo
9926df7c08
Merge pull request #626 from alphagov/jenkins_deploy_stage
...
Disable Travis deploys for staging
2016-08-23 16:56:48 +01:00
Martyn Inglis
09cb94081b
Returns the outcome statistics for the job on the API call.
2016-08-23 16:46:58 +01:00
bandesz
e6177a2163
Disable Travis deploys for staging
2016-08-23 16:45:21 +01:00
Andras Ferencz-Szabo
e2c028c752
Merge pull request #625 from alphagov/jenkins_deploy_dev
...
Fix version file generation, remove master deploys from travis
2016-08-23 14:07:28 +01:00
Leo Hemsted
9d624ef280
prevent errors if user has no venv setup at all
2016-08-23 13:56:10 +01:00
bandesz
f113309713
Fix version file generation, remove master deploys from travis
2016-08-23 13:44:34 +01:00