Commit Graph
3972 Commits
Author SHA1 Message Date
stvnrlly 77c0faf4e5 more test fixes, one test remaining 2022-11-28 13:51:37 -05:00
Ryan Ahearn 75e1975de1 Fix tests that were relying on local timezone 2022-11-28 12:22:22 -05:00
Ryan Ahearn 2f9cb5ae6d Fix message status test 2022-11-28 12:21:44 -05:00
stvnrlly 9689aaf89b more test fixes & letter trimming 2022-11-28 11:15:41 -05:00
stvnrlly 8bd1285bfa more test fixes 2022-11-28 10:48:51 -05:00
stvnrlly a2b58c926e more test fixes & letter trimming 2022-11-22 22:50:47 -05:00
stvnrlly ca1897973a test time fixes and bonus letter removal 2022-11-22 17:03:42 -05:00
stvnrlly 86b28e5e44 some test updates 2022-11-22 16:33:55 -05:00
stvnrlly 46723b6c11 initial timezone pass, which breaks many tests 2022-11-22 12:00:29 -05:00
Ryan Ahearn a79adeb060 Update test for US spelling of organization 2022-11-04 13:17:57 -04:00
stvnrlly 3386317f5b trim non-existant pages further 2022-11-02 11:02:32 -04:00
stvnrlly 9692185cd6 some test tweaks for page reductions 2022-11-02 10:45:09 -04:00
stvnrlly 218eb3559f Merge branch 'main' into stvnrlly-remove-broadcasts 2022-10-26 01:27:44 +00:00
Steven Reilly 04aba21296 Merge pull request #139 from GSA/stvnrlly-hide-letters
Hide letters in non-admin UI
2022-10-18 11:35:44 -04:00
stvnrlly b6a6a14bc7 now with even fewer letters 2022-10-18 15:27:13 +00:00
Steven Reilly 345516606f Merge pull request #59 from GSA/stvnrlly-update-form-flow
Update services for post-sign-up tour
2022-10-17 09:43:32 -04:00
stvnrlly 44e8c0fe89 post-merge flake8 fix 2022-10-17 13:42:36 +00:00
Steven Reilly 3cabdf4f38 Merge branch 'main' into stvnrlly-hide-letters 2022-10-14 15:33:01 -04:00
stvnrlly aac17bb2af get flake8's approval 2022-10-14 19:22:03 +00:00
stvnrlly 38fa1286b2 clean up admin ui & update tests 2022-10-14 18:58:55 +00:00
stvnrlly a2c6c2f08c remove letters from dashboard 2022-10-13 20:51:45 +00:00
stvnrlly 067b4b3742 swap dollar symbols for pound symbols 2022-10-12 20:16:22 +00:00
stvnrlly f16b5dd1c4 remove broadcast-related code 2022-10-04 03:04:13 +00:00
Ryan Ahearn 5f1a1f083a Proactively specify aws region for s3 operations 2022-09-26 10:25:03 -04:00
Ryan Ahearn a90dcc918b Provide s3 credentials for each individual bucket 2022-09-23 12:59:55 -04:00
Ryan Ahearn 7ce9f8cfcb Remove MOU bucket, for now 2022-09-21 23:18:15 -04:00
stvnrlly 3e7b5b4370 update tests based on updated orgs 2022-09-15 18:47:04 +00:00
jimmoffet f2b47c9e74 fix weird freeze_time decorator spacing 2022-09-13 13:34:45 -07:00
jimmoffet 4b5e659d3f fix weird pytest decorator spacing 2022-09-13 13:30:52 -07:00
jimmoffet b7435aefed clean up comments 2022-09-13 13:18:25 -07:00
jimmoffet 24c9854ca6 testing for get_jobs in service dashboard 2022-09-13 13:16:17 -07:00
jimmoffet c702104421 fix redis mocking for test runner 2022-09-12 17:38:53 -07:00
jimmoffet e77e9200cd dummy phone 2022-09-09 17:16:01 -07:00
jimmoffet 69abec0bb3 change dashboard test to reflect demo changes to uploads view 2022-09-09 17:02:48 -07:00
Ryan Ahearn 68129bc9f4 Address flake8 issues 2022-08-09 14:14:49 +00:00
jimmoffet b465131338 all tests passing 2022-08-05 01:22:32 -07:00
jimmoffet dad051a662 2767 passing 2022-08-05 00:25:03 -07:00
Ben Thorner 543be77776 Merge pull request #4258 from alphagov/speed-up-templates-page-179736794
Optimise load time for service "Templates" page
2022-06-08 13:37:58 +01:00
Chris Hill-Scott b91babc67e Fix relative URLs in support tickets
When we get a support ticket we put a link to the service at the end.

As part of 8b7f2fbf04 we accidentally made
these URLs relative, rather than absolute. This means they aren’t made
into links by email clients or Zendesk.

This commit fixes the links to include the domain again.
2022-06-07 13:50:24 +01:00
Ben Thorner bcfc6ce707 Decouple deletion tests from "get_templates" fn
Using create_template here is easier than template_json as it has
various parameters preset [^1].

[^1]: https://github.com/alphagov/notifications-admin/blob/master/tests/conftest.py#L3986
2022-06-07 11:05:33 +01:00
Chris Hill-Scott 8b7f2fbf04 Stop using _external=True in tests
It looks like, by default, Flask no longer makes full URLs, for example
`https://example.com/path`. Instead it does `/path`. This will still
work fine, and if anything is better because it reduces the number of
bytes of HTML we are sending.

It won’t mean that requests go over `http` instead of `https` without
the protocol because we set the appropriate HSTS header here:
https://github.com/alphagov/notifications-aws/blob/0c57da7781260c56575b796062795a9d8e1f8c87/ansible/roles/paas-proxy/templates/admin.conf.j2#L11

This commit changes all our tests to reflect that URLs no longer have
the protocol and domain in them. `_external=True` is Flask’s way of
saying whether a URL should be generated with the domain and protocol
(`True`) or without it (`False`).

Again, I can’t find the changelog or diff where this was introuduced,
but if you’d like to go spelunking then here’s a starting point:
https://github.com/pallets/flask/blob/50374e3cfe815acd24fd390c861561a0dd17bfbb/src/flask/helpers.py#L192
2022-06-06 12:12:52 +01:00
Chris Hill-Scott fc833c802e Update tests to reflect unencoded commas in URLs
I can’t find the changelog for this but it looks like somewhere someone
has decided that commas don’t need to be URL-encoded. This is true for
use in `href` attributes because it’s unambiguous that the comma is part
of the URL (unlike a closing quote for example, which could be
misinterpreted as HTML syntax).

This commit jut changes the test to reflect that the URLs generated by
Flask now have raw commas in them.
2022-06-06 12:12:52 +01:00
Ben Thorner f500db44f1 Reuse TemplateList class when deleting a folder
Part of moving "get_template_folders" et al. into TemplateList so we
can cache it more effectively. This is slightly less efficient as
iterating a TemplateList will instantiate an object for each item
in the folder; but the difference is minimal.

Note that:

- The default template_type for TemplateList is "all".
- We need to pass realistic template "JSON" in the test now.
2022-06-06 10:36:47 +01:00
Ben Thorner fe13bb8dbc Merge pull request #4254 from alphagov/fix-go-live-bug-179736794
Fix go-live checks ignoring nested templates
2022-06-06 10:36:28 +01:00
Ben Thorner ee3d2d1804 Bump utils to version 56.0.0
The only impactful change is the major version itself, where I've
fixed the breaking changes due to the upgrade of PyPDF2 [^1] and
checked there are no deprecation warnings when I run the tests.

[^1]: https://github.com/alphagov/notifications-utils/pull/973
2022-06-01 13:29:54 +01:00
Ben Thorner c6977b13a0 Simplify stubs in go-live tests
This replaces multiple stubs with a single stub on the lower level
API client method to return the desired set of templates. You can
see this most clearly in the diff for the "_sms_sender_" test:

- Add a stub for "get_service_templates"
- Remove stubs for "all_templates" and "get_templates"

In order to make the change, I had to separate the reply-to set of
tests from the "_things_right" tests because "count_of_templates"
was actually in conflict with "count_of_email_templates". To make
the new test I copied the original and removed unnecessary stubs
from both of them depending on what's being tested.

I'm not sure what the "_things_right" test name means; the name of
the new test is at least consistent with others in the file.

Note: I also removed the "assert mock_templates.called is True"
lines as they wasn't adding any value that I can see.
2022-05-27 12:46:32 +01:00
Katie Smith cdfe852d25 Add filetype to all links to download user reports / examples 2022-05-24 10:27:27 +01:00
David McDonald 19e6e38426 Calculate page count based on template values when previewing
Similar to the bug shown here
https://www.pivotaltracker.com/story/show/181513431, but to fix the case
when previewing a letter send using a CSV upload it wasn't using
template values to calculate the page length.
2022-05-16 15:44:05 +01:00
Ben Thorner 84dde0f824 Merge pull request #4229 from alphagov/monthly-usage-multirate-181935935
Support multiple rates in monthly SMS usage
2022-05-11 11:26:44 +01:00
Ben Thorner bb0fb73bc8 Minor tweaks in response to PR comments
In response to [^1] and [^2].

[^1]: https://github.com/alphagov/notifications-admin/pull/4229#discussion_r869181152
[^2]: https://github.com/alphagov/notifications-admin/pull/4229#discussion_r869186063
2022-05-10 17:00:51 +01:00