I know that there were answers to various questions, but the fact is that:
I have some unit tests and they sometimes work fine, but sometimes I get
"The parent instance is not associated with the session"
So, how would I start debugging something like this if this happens by accident.
Oh, and there was a challenge before the error db.session.add(my_item).
source
share