Factory Boy - Trytond integration
Project description
Factory-trytond
Factory-trytond is a factory_boy extension developed to work with Tryton ERP. We can create our own ERP's model factories to do some testing or to populate our databases with some sample data.
How does it work?
Steps to use Factory-trytond:
- Inherit the base factory class.
- Define the meta model the factory will construct.
- Define the default declarations of the factory.
Note that the meta model can be a trytond pool model name.
Here's a factory example with Tryton's model User:
import factory
import factory_trytond
class UserFactory(factory_trytond.TrytonFactory):
class Meta:
model = 'res.user'
name = factory.Faker('name')
login = factory.Faker('user_name')
user = UserFactory.build()
user.save() # it is a standard Tryton object as would be returned by Tryton's object pool
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
factory-trytond-1.0.0.tar.gz
(15.2 kB
view details)
Built Distribution
File details
Details for the file factory-trytond-1.0.0.tar.gz
.
File metadata
- Download URL: factory-trytond-1.0.0.tar.gz
- Upload date:
- Size: 15.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1382ee4bf2dd8e09a37a36594b889f4bc16746c8c6cdc2b9b04cde06c9f55ad |
|
MD5 | 941863dc0f63f77574c5b88b64272d92 |
|
BLAKE2b-256 | 8f4e165c12c19d4d9487a8b3da0d55b7d5532c73d9fb9c796ddec18c2e1df2a5 |
File details
Details for the file factory_trytond-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: factory_trytond-1.0.0-py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a547f2c77d18e9e30219d7b625d64789de5fd7dce7a11224c73001e26f5632d |
|
MD5 | ebfb7607e03c5abe81807c45f04b9e45 |
|
BLAKE2b-256 | 9c4076faf9bb79f3d881953c6284d39f0bdbd6eef8756fe02dd8cf5914eb21e4 |