Commit Graph

294 Commits

Author SHA1 Message Date
Pea Tyczynska
deb360846d Mark letters from insolvency service
So that DVLA knows to process them separately to avoid issues.
2020-10-21 16:56:18 +01:00
David McDonald
f9911c7965 Send broadcast invite email for broadcast service invites
This means the copy is more accurate and mentions sending emergency
alerts rather than previous copy about sending emails texts and letters.
2020-09-15 16:47:41 +01:00
David McDonald
23ac7bcf56 Use sample broadcast service instead of sample service for tests
We only want to use a service that has permissions for broadcasts to
make our tests more realistic
2020-09-15 16:47:41 +01:00
Chris Hill-Scott
65346852ed Rename variables and functions in tests
To reflect the new name of the feature.
2020-07-28 12:56:32 +01:00
Chris Hill-Scott
083573e4dc Rename model
Reflects the new name of the feature.

Note that the name of the underlying table hasn’t changed because it’s
explicitly set to `service_whitelist`. Changing this will be a more
involved process.
2020-07-28 12:56:04 +01:00
Rebecca Law
a13bcc6697 Reduce the pressure on the db for API post email requests.
Instead of saving the email notification to the db add it to a queue to save later.
This is an attempt to alleviate pressure on the db from the api requests.
This initial PR is to trial it see if we see improvement in the api performance an a reduction in queue pool errors. If we are happy with this we could remove the hard coding of the service id.

In a nutshell:
 - If POST /v2/notification/email is from our high volume service (hard coded for now) then create a notification to send to a queue to persist the notification to the db.
 - create a save_api_email task to persist the notification
 - return the notification
 - New worker app to process the save_api_email tasks.
2020-03-25 07:59:05 +00:00
Leo Hemsted
48a735c58c remove unused fixture 2019-12-13 10:02:39 +00:00
Katie Smith
544a7a2311 Remove parameters from fixtures
Since Pytest 4, we can't call fixtures as if they were functions. This
change removes the parameters from the fixtures (since we can't use
them), except for when the parameter is another fixture.
2019-11-01 14:34:15 +00:00
Katie Smith
6411e10d7b Remove unused fixtures 2019-11-01 13:18:07 +00:00
Katie Smith
87d7ed21a2 Fix fixtures
Stopped 2 fixtures from calling other fixtures as functions and causing
errors.
2019-10-31 15:04:23 +00:00
Katie Smith
fb875c50c1 Stop fixtures in conftest from calling other fixtures
Stopped some the fixtures in conftest.py from calling other
fixtures as functions to make them Pytest 4 compliant.
2019-10-30 11:22:36 +00:00
Katie Smith
99c3837dc1 Fix the fixtures for templates lacking certain permissions
These fixtures were both calling other fixtures as functions and being
called as functions in the tests. Rewriting the tests to make them
Pytest 4 compatible means we are no longer using
`sample_template_without_letter_permission`, so this has been deleted.
2019-10-30 11:22:36 +00:00
Katie Smith
a2c25cec9f Make a couple of fixtures Pytest 4 compliant
By stopping them from calling other fixtures as functions.
2019-09-18 12:01:20 +01: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
Pea Tyczynska
9dfc550f46 Add org types table 2019-07-18 17:05:22 +01:00
Leo Hemsted
a0c0dec429 add tests
include dynamically loading the template contents from the alembic upgrade file itself
2019-07-12 15:14:13 +01:00
Rebecca Law
1f9aade749 - Adding test where post_notification can't send to a member outside of the team or whitelist.
- Updating some tests to be pytest4 compliant.
2019-06-11 16:45:35 +01:00
Katie Smith
844f22bcd0 Remove unused fixture and add test function to create permissions 2019-06-05 14:54:52 +01:00
Pea Tyczynska
615ea6a98a Send verifcation email to a new reply-to email address 2019-05-23 15:36:09 +01:00
Alexey Bezhan
330afab5e2 Make Firetext URL configurable through the application environment
Similar to MMG, there's a new env variable FIRETEXT_URL that can be
used to override the Firetext api URL.

This will be used to stub out both providers during the load test or
can be used to run a local API against a fake provider endpoint.
2019-04-12 12:03:58 +01:00
Katie Smith
31ddd36e2c Update invited user tests to take folder_permissions into account 2019-03-22 09:30:39 +00:00
Pea Tyczynska
211d3741ba Send confirmation emails to users when team manager edits their
email address  or mobile number.
2019-02-26 16:30:29 +00:00
Pea Tyczynska
8ef581de69 Remove service.postage and choose_postage permission from the code and tests 2019-02-11 18:20:34 +00:00
Pea Tyczynska
5b9e6c2086 Set postage on basis of postage argument or template postage 2019-02-06 13:23:09 +00:00
Pea Tyczynska
eea324a19d Add flag on create_service to decide whether we should also check if service exists 2019-01-03 10:57:29 +00:00
Pea Tyczynska
f79c0b03e7 Sample job uses create_template instead of sample template 2019-01-03 10:52:14 +00:00
Pea Tyczynska
cde30de100 Use create_template instead of sample_template in sample_notification 2019-01-03 10:52:14 +00:00
Pea Tyczynska
154257027f Nothing in conftest uses sample_service now :) 2019-01-03 10:52:14 +00:00
Pea Tyczynska
d367daaf6e Some more conftest fixtures use create_service instead of sample_service 2019-01-03 10:52:14 +00:00
Pea Tyczynska
a3310c2da6 sample_job uses create_service instead of sample_service 2019-01-03 10:52:14 +00:00
Pea Tyczynska
0bcf13d85c sample_api_key uses create_service instead of sample_service 2019-01-03 10:52:14 +00:00
Pea Tyczynska
e8ce669b72 Use create_service instead of sample_service when creating sample_email_template for tests 2019-01-03 10:52:14 +00:00
Pea Tyczynska
95115e7ae6 Use create_service instead of sample_service when creating service permission for tests 2019-01-03 10:52:14 +00:00
Pea Tyczynska
923703120b Check if test service exists before it gets created 2019-01-03 10:52:14 +00:00
Pea Tyczynska
c12594949f Refactor service_factory 2019-01-03 10:49:38 +00:00
Pea Tyczynska
686c58acee Test post letter request sets notification postage correctly 2018-12-24 11:27:29 +00:00
Leo Hemsted
bf62d3ad5f infer template/service from job for notification/ft_noti_status in db.py 2018-12-12 12:59:55 +00:00
Pea Tyczynska
f941b8b146 Use archived flag to see if job needs deleting from s3 bucket 2018-11-28 14:38:59 +00:00
Leo Hemsted
3589f1dd63 remove some use of calling fixtures directly
also experiment with giving the fixtures a different name, so we can be
sure that they won't be called in functions. Open to change on this.
2018-10-17 16:38:46 +01:00
Katie Smith
6727f0e0f5 Update ft_billing DAO functions to use postage
* Updated the 'fetch_billing_data_for_day' DAO function to take postage into
account
* Updated the 'update_fact_billing' DAO function to insert postage for
new rows. When updating rows which are identical apart from the postage, the
original row will be kept. (This behaviour will change once postage is
added to the primary key - at this point, upserting will add a new row.)
* Also changed some fixtures / test set up functions to take postage
into account
2018-09-28 13:52:17 +01:00
Rebecca Law
1c0892888f Change the name of letter_class to postage, this will match the domain language used in the documentation.
Updated the tests to answer review comments.
2018-09-18 15:22:08 +01:00
Leo Hemsted
32415b3b14 add delete functions for inbound and callback api objects
Both service api tasks work fine if the object is unexpectedly deleted
halfway through - they both check to see if the api details are still
in the DB before trying to send the request.
2018-07-05 11:09:17 +01:00
Katie Smith
0d4fb81235 Delete ProviderStatistics model
This is not being used anywhere, so can be deleted safely.
2018-05-21 15:03:39 +01:00
venusbb
5d7d4a0dd6 Added test for reporting tasks 2018-03-14 17:07:52 +00:00
Rebecca Law
bffc4863db Remove all methods no longer used now that we only send pdf files to DVLA. 2018-03-02 11:05:05 +00:00
Rebecca Law
7faf375375 Merge pull request #1695 from alphagov/org-user-endpoints
Organisation user endpoints
2018-02-26 16:27:01 +00:00
Alexey Bezhan
984a5050db Don't return hidden templates in API service template responses
Brings back filtering hidden templates from the API responses.
2018-02-26 13:28:08 +00:00
Alexey Bezhan
9b3a9a55c4 Revert "Don't return hidden templates in API service template responses"
Filtering out hidden templates requires all existing templates to
have `hidden` flag set, which can only be done by a migration after
the code that sets the flag to `False` by default for new templates
has been released.

This removes the filtering logic until the migration has been released.
2018-02-26 11:44:25 +00:00
Alexey Bezhan
19dbe7da8d Don't return hidden templates in API service template responses
Removes hidden templates from the service templates list and returns
404 when searching for a hidden template or template versions by ID.
2018-02-23 17:52:25 +00:00
Alexey Bezhan
e659253b01 Set Notify service user as the creator of Pre-compiled PDF template 2018-02-23 17:52:24 +00:00