Let's say I have two model objects foo and bar, and let's say that soft deleting foo has the side effect of also soft deleting bar.
For unit testing, I'd like to be able to do something like
foo.delete()
(...)
foo.undelete()
bar.undelete()
This will fail with an AssertionError because bar is desynchronized from the db. However, we also can't use bar.refresh_from_db() because the default manager doesn't find it anymore (see also: #73 ).
Let's say I have two model objects
foo
andbar
, and let's say that soft deletingfoo
has the side effect of also soft deletingbar
.For unit testing, I'd like to be able to do something like
This will fail with an
AssertionError
becausebar
is desynchronized from the db. However, we also can't usebar.refresh_from_db()
because the default manager doesn't find it anymore (see also: #73 ).