Commit Graph

44 Commits

Author SHA1 Message Date
stvnrlly
f764414bc2 Merge branch 'main' into notify-api-446 2023-09-06 16:05:45 -04:00
Kenneth Kehl
e9280b44b0 notify-api-446 change default text message sender from U.S. Notify 2023-08-31 08:14:23 -07:00
Kenneth Kehl
fb3a6cca68 notify-api-59 make command to create new service 2023-08-30 13:13:43 -07:00
Kenneth Kehl
1ecb747c6d reformat 2023-08-29 14:54:30 -07:00
Kenneth Kehl
c5008da8df cleanup 2023-08-15 11:44:47 -07:00
Kenneth Kehl
b4a2f37ca9 get coverage up to 94% 2023-08-14 09:04:06 -07:00
Kenneth Kehl
e1ce20f5e3 try a couple more 2023-08-14 07:41:17 -07:00
Kenneth Kehl
46f4d72292 try putting back a file based test 2023-08-14 07:21:18 -07:00
Kenneth Kehl
f94b0bfc59 remove the multiple workers from the tests 2023-08-11 15:02:34 -07:00
Kenneth Kehl
5c7cfb7b9e remove the multiple workers from the tests 2023-08-11 14:42:21 -07:00
Kenneth Kehl
0f257c20f8 remove the multiple workers from the tests 2023-08-11 14:23:16 -07:00
Kenneth Kehl
f7b822b950 more fix because local is different for some reason 2023-08-11 13:58:35 -07:00
Kenneth Kehl
00a2f99346 more fix because local is different for some reason 2023-08-11 13:48:45 -07:00
Kenneth Kehl
a9dd560edf more fix because local is different for some reason 2023-08-11 13:25:48 -07:00
Kenneth Kehl
dcb9563f9c more fix because local is different for some reason 2023-08-11 13:14:04 -07:00
Kenneth Kehl
66fc5abb0a more fix because local is different for some reason 2023-08-11 12:57:26 -07:00
Kenneth Kehl
288183b9e5 more fix because local is different for some reason 2023-08-11 12:47:06 -07:00
Kenneth Kehl
eaa8df4ab6 more fix because local is different for some reason 2023-08-11 12:34:06 -07:00
Kenneth Kehl
98208cff40 more fix because local is different for some reason 2023-08-11 12:21:54 -07:00
Kenneth Kehl
157a4bdb18 more fix because local is different for some reason 2023-08-11 12:07:08 -07:00
Kenneth Kehl
11a9351290 fix test 2023-08-11 11:57:00 -07:00
Kenneth Kehl
85604e5394 more tests 2023-08-11 11:47:57 -07:00
Kenneth Kehl
318bb01392 more 2023-08-10 12:58:52 -07:00
Kenneth Kehl
4940d5e93b notify-api-332 rename organisation 2023-07-10 11:06:29 -07:00
Steven Reilly
dc06b411ca Update default templates and add update command (#166)
This commit adds config_files for default data and, using that, creates a new way to update our default templates without needing to hardcode a migration.

---------

Co-authored-by: Ryan Ahearn <ryan.ahearn@gsa.gov>
2023-02-03 10:11:21 -05:00
Ryan Ahearn
82df01653f Update tests to focus on US numbers 2023-01-05 11:06:12 -05:00
stvnrlly
11d123051a validate mobile number so that sms auth works 2022-10-28 14:42:25 -04:00
stvnrlly
19cdd9b052 tests & prompts for user creation command 2022-10-28 14:07:43 -04:00
stvnrlly
d4e156e8ae Merge branch 'main' into stvnrlly-remove-broadcasts 2022-10-20 19:44:20 -04:00
stvnrlly
b0ed88e7a3 update tests 2022-10-12 16:39:17 +00:00
stvnrlly
0186095920 swap out uk org types for us-specific org types 2022-10-11 20:27:49 +00:00
stvnrlly
53204c307b tests are, uh, mostly passing 2022-10-05 01:12:35 +00:00
stvnrlly
57f4df8ed1 remove broadcast-related code, except migrations 2022-10-04 15:28:27 +00:00
Rebecca Law
1e473fd216 Unit test for command 2022-03-22 10:33:05 +00:00
Katie Smith
67d1b3719e Stop blank strings being inserted as inbound numbers
We had an inbound number in the database with a value of ''. This
could happen if there are blank lines in the inbound numbers file
we use for the `insert-inbound-numbers` command. To avoid this
happening again, the command now calls `.strip()` on each line of the
file and only inserts a row if the result is truthy (i.e. not '').
2022-03-01 15:31:54 +00:00
Ben Thorner
c9ea85938a Refactor "create_user" to actually create a user
This switches a number of fixtures to use "sample_user", which is
equivalent to calling the previous "create_user" function when it
used to default the email to "notify@...".
2021-09-14 09:29:28 +01:00
Ben Thorner
922fd2f333 Support testing commands and add first test
We have a lot of commands and it's important we test the ones that
are meant to be used in the future to ensure they work when they're
needed. Testing Flask commands is usually easy as written in their
docs [1], but I had to make some changes to the way we decorate the
command functions so they can work with test DB objects - I couldn't
find any example of someone else encountering the same problem.

[1]: https://flask.palletsprojects.com/en/2.0.x/testing/#testing-cli-commands
2021-09-14 09:29:23 +01:00
Leo Hemsted
ba612b0f5b make sure redis command filters dates properly
also write the tests that i should have written a while ago for this
2018-04-05 15:11:29 +01:00
Chris Hill-Scott
ca167206d5 Add command to backfill Performance Platform totals
We don’t have any way of playing back the totals we send to performance
platform.

This commit copies the command used to backfill the processing time and
adapts it to backfill the totals instead. Under the hood it uses the
same code that we use in the scheduled tasks to update performance
platform on a daily basis. I had to modify this code to take a `day`
argument because it was hardcoded to only work for ‘yesterday’.
2018-03-05 17:02:33 +00:00
Leo Hemsted
5b7118973e take advantage of click's type validation/coercion
(saves us having to write the stuff ourselves). Also adds a small
click plugin to do datetime parsing.

Sample output:

```
[leohemsted:~/dev/api]$ flask command create_provider_rates --help
Usage: flask command create_provider_rates [OPTIONS]

  Backfill rates for a given provider

Options:
  -p, --provider_name [mmg|firetext|ses]
                                  [required]
  -c, --cost FLOAT                Cost (pence) per message including decimals
                                  [required]
  -d, --valid_from DATE           [required]
  --help                          Show this message and exit.
[leohemsted:~/dev/api]$ flask command create_provider_rates -p ses -c 1.234 -d invalid
Usage: flask command create_provider_rates [OPTIONS]

Error: Invalid value for "-d" / "--valid_from": Could not parse datetime string "invalid" formatted as %Y-%m-%dT%H:%M:%S
```
2017-11-28 12:50:29 +00:00
Leo Hemsted
4c14e3279f ensure the app context is included in every single flask command 2017-11-24 12:01:28 +00:00
Leo Hemsted
5466b7cd3c fix test create_app invocation 2017-11-23 17:04:58 +00:00
Leo Hemsted
b2436b3e02 add command to application.py 2017-08-31 15:01:38 +01:00
Leo Hemsted
378b131c59 add batch task to backfill processing time data
give it a start date and an end date, and it'll send data to the
performance platform for all dates in that (inclusive)
2017-08-31 14:41:05 +01:00