Change ReviewRequestVisit.objects.update_visibility to use upsert.
Review Request #12697 — Created Oct. 25, 2022 and submitted
Django has a new(ish) method for handling upserts itself,
update_or_create. Switching to this actually fixes a bug in the
existing code where
update_visibilitywasn't updating the timestamp if
the visibility wasn't changing.
While updating this, I noticed that the unit tests for these weren't in
accounts/tests/directory so I've moved that too.
Ran unit tests.
Add an unstaged change: switch to
assertQueriesin order to handle savepoints.
Revision 2 (+34 -14)