Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

session.commit() destroys instance to_dict output #17

Open
aristizabal95 opened this issue Sep 27, 2024 · 0 comments
Open

session.commit() destroys instance to_dict output #17

aristizabal95 opened this issue Sep 27, 2024 · 0 comments

Comments

@aristizabal95
Copy link

The mocked session is not behaving as expected. When using a SQLAlchemy session, the following code works:

with Session():
    session.add(my_obj)
    session.commit()

print(my_obj.to_dict())

to_dict() returns the dictionary version of the object created. When, instead, I use the mocked_session, as soon as session.commit() runs, my_obj.to_dict() returns an empty dictionary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant