Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
SQLAlchemy Support #64
class UserFactory(SQLAlchemyModelFactory): FACTORY_FOR = User SESSION = DBSession email = 'email@example.com' username = 'rcommande'
The "SESSION" attribute is the SQLAlchemy session object with which you want to work.
I see you're using some
Anyway, thanks for helping bring factory_boy to SQLAlchemy!
I have moved the SQLAlchemyModelFactory to factory.alchemy module and add some tests (the same as django module)
I renamed "SESSION" attribute to "FACTORY_SESSION"
For the session object, it's the equivalent to django manager objects but it's an external object.
Also, the session object contains the connection configuration.
The SQLAlchemyModelFactory class is totally abstract and can work with any project as long as you provide a session object.