uber / charlatan

A Python library to efficiently manage and install database fixtures
https://charlatan.readthedocs.org/en/latest/
Other
89 stars 12 forks source link

call save when loading something from depend_on #8

Closed Roguelazer closed 10 years ago

Roguelazer commented 11 years ago

here's another one, @charlax / @tiny-mouse

charlax commented 11 years ago

Thanks a lot for this PR! I'm not sure what's the full context here though. Isn't this changing an expected behavior?

Roguelazer commented 11 years ago

Te original reason I wanted depend_on was because the constructor of the depender expected certain properties of the database. If you never call .save() on the depended-upon fixture, then it doesn't actually meet my needs.

I agree that it's weird -- although I actually think it's weirder that we don't save relationship dependencies. That means that different methods of using SQLalchemy will interact differently with relationship dependencies. Unfortunately, it completely breaks our API test cases if we try to save relationship dependencies because a lot of them turn out to violate key constraints (another bad part about not saving -- constraints aren't evaluated), so I didn't change that part.

charlax commented 11 years ago

Oooh I get it. This is the public repo and we shouldn't be blocked by wrong behavior in other tools. The default should be to always save relationships and depend_on. What do you think?

charlax commented 11 years ago

Hey - any update here?