department-of-veterans-affairs / notification-api

Notification API
MIT License
16 stars 9 forks source link

BUG: remove all opt-out unit test failure #1636

Open kalbfled opened 9 months ago

kalbfled commented 9 months ago

Description

tests/lambda_functions/va_profile/test_va_profile_remove_old_opt_outs.py::test_remove_opted_out_records_query contains this snippet:

# TODO 1636 - This should not be commented out.
# assert notify_db_session.session.get(VAProfileLocalCache, opt_out_id) is None

The test should pass even when this is not commented out. Of the two parametrized cases, only "lambda_handler" fails. The other case uses SQLAlchemy to run a stored procedure and directly commits the change. The lambda handler case uses the lambda implementation, which uses psycopg2 to execute and commit the query.

The remove old opt-outs functionality seemed to work when we manually tested it, but it isn't being used. The first step for this ticket is to ensure the query works in AWS.

Steps to Reproduce

  1. Uncomment, and run the unit test.

Impact/Urgency

Expected Behavior

Additional Info & Resources

npmartin-oddball commented 2 weeks ago

Linked to team-1412. https://github.com/department-of-veterans-affairs/vanotify-team/issues/1412