Open aalvrz opened 1 year ago
Your SQLAlchemy code is incomplete; it is not enough to define a class with some attribute. SQLAlchemy uses declarative mapping. You also need to create a session instance and and not just provide the Session
class to SQLAlchemyModelFactory
.
I suggest trying the the code example in the factory-boy docs first; you could add a JSON column to that: https://factoryboy.readthedocs.io/en/stable/orms.html#sqlalchemy
Description
Not sure if this is a Factory Boy bug or SQLAlchemy bug.
When trying to persist more complex dictionaries within a JSON field/column of a SQLAlchemy model, the data is only partially persisted.
Model / Factory code
The issue
Set a more complex dictionary for the
data
JSON field when generating objects with the factory:The object is created, but the
data
field is persisted as:Notes