Closed dheitzer closed 1 month ago
This looks great but I think we might want some tests for the commands. I'm not quite sure how challenging this would be to implement, but I did some quick research and it looks like we can use call_command and patch to simulate running these commands in a test https://docs.djangoproject.com/en/5.1/ref/django-admin/#running-management-commands-from-your-code https://docs.python.org/3/library/unittest.mock.html#unittest.mock.patch
Issues
7 New issues
0 Accepted issues
Measures
0 Security Hotspots
96.6% Coverage on New Code
0.0% Duplication on New Code
This looks great but I think we might want some tests for the commands. I'm not quite sure how challenging this would be to implement, but I did some quick research and it looks like we can use call_command and patch to simulate running these commands in a test https://docs.djangoproject.com/en/5.1/ref/django-admin/#running-management-commands-from-your-code https://docs.python.org/3/library/unittest.mock.html#unittest.mock.patch
good catch - I added coverage to these cmds
Summary
https://fecgov.atlassian.net/browse/FECFILE-1552
How to test
New commands to support this functionality are documented in the devops app README with a SOP for both the django key and login cert rotation being uploaded to the shared drive.
Unfortunately Django commands to not support sub directories so some devops commands were renamed for clarity.
Both commands tested in the develop environment.