You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an entity with a structured property is fetched later/in a different context, NDB auto-adds a key to the structured property's model instance. However, it does not do so when initially creating the instance.
This issue is mainly a nuisance/annoyance when trying to write tests -- We often do test setup in one context, but then our API code creates a new context as a part of its WSGI middleware. We have mocks/spies that make assertions and want to ensure that a particular entity is passed in to some callable, but the objects differ due to the presence of the empty key n the structured properties.
(we have already updated our tests to work around this)
Environment details
python-ndb 1.11.1
Python 2.7.18
Tested on MacOS 12.6.1
Steps to reproduce
Code example
Stack trace
N/A, it raises on my assertion statement, not deep in the NDB library.
The text was updated successfully, but these errors were encountered: