This changeset pulls in all of the notification_utils code directly into the admin and removes it as an external dependency. We are doing this to cut down on operational maintenance of the project and will begin removing parts of it no longer needed for the admin.
Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
The test makes use of list item unpacking and expects the parameter data structure to allow for that. It does not make sense to modify the code in this case just to make test format linting pass.
Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
This syntax makes it clearer what is being tested here, because it’s
unusual to see a decorator being manually called with function as its
first argument.
It’s also consistent with how the later tests in this file are written.
This user is only re-used once, which isn’t a big saving. By putting it
inside the test it’s easy to see what special conditions are being set
up that result in the expected outcometest result.
By making the one platform admin case a separate test we no longer
need to pass in a `user` or `kwargs` to the parametrize every time,
making it easier to read.
It’s easier to see what the different test cases are when they are laid
out with `parametrize`, rather than separate functions with lots of
boilerplate.
The helper function handles both tests that pass, and tests that are
expected to fail (either by raising an exception or returning a redirect
to the login page).
By moving the handling of cases which are expected to fail out of the
helper function we can make the helper function less complex, which will
make further refactoring easier.