Metadata-Version: 2.1
Name: factory-trytond
Version: 0.1.0
Summary: Factory Boy - Trytond integration
Home-page: https://github.com/calidae/factory-trytond
Author: Calidae
Author-email: dev@calidae.com
License: GPL-3
Platform: UNKNOWN
Classifier: Framework :: Tryton
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Requires-Python: >=3.5
Description-Content-Type: text/markdown
Requires-Dist: factory-boy
Requires-Dist: trytond

# Factory-trytond

Factory-trytond is a [factory_boy](https://factoryboy.readthedocs.io/en/latest/introduction.html) extension developed to work with [Tryton ERP](https://www.tryton.org/).
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:
1. Inherit the base factory class.
2. Define the meta model the factory will construct.
3. 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**:
```python
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
```


