%global _empty_manifest_terminate_build 0
Name: python-mimesis-factory
Version: 1.2.0
Release: 1
Summary: Mimesis integration with factory_boy
License: MIT
URL: https://github.com/mimesis-lab/mimesis-factory
Source0: https://mirrors.aliyun.com/pypi/web/packages/34/2e/392b366d45ee16523f6e751a40f7e4050f19ab2c6a6572827d3baecb60f7/mimesis_factory-1.2.0.tar.gz
BuildArch: noarch
Requires: python3-factory-boy
Requires: python3-mimesis
%description
## mimesis_factory
[](https://travis-ci.com/mimesis-lab/mimesis-factory)
[](https://coveralls.io/github/mimesis-lab/mimesis-factory?branch=master)
[](https://badge.fury.io/py/mimesis-factory) [](https://github.com/wemake-services/wemake-python-styleguide)
## Description
[Mimesis](https://github.com/lk-geimfari/mimesis) integration for [`factory_boy`](https://github.com/FactoryBoy/factory_boy).
## Installation
```python
➜ pip install mimesis_factory
```
## Usage
Look at the example below and you’ll understand how it works:
```python
class Account(object):
def __init__(self, username, email, name, surname, age):
self.username = username
self.email = email
self.name = name
self.surname = surname
self.age = age
```
Now, use the `MimesisField` class from `mimesis_factory`
to define how fake data is generated:
```python
import factory
from mimesis_factory import MimesisField
from account import Account
class AccountFactory(factory.Factory):
class Meta(object):
model = Account
username = MimesisField('username', template='l_d')
name = MimesisField('name', gender='female')
surname = MimesisField('surname', gender='female')
age = MimesisField('age', minimum=18, maximum=90)
email = factory.LazyAttribute(
lambda instance: '{0}@example.org'.format(instance.username)
)
access_token = MimesisField('token', entropy=32)
```
## pytest
We also recommend to use [`pytest-factoryboy`](https://github.com/pytest-dev/pytest-factoryboy).
This way it will be possible to integrate your factories into `pytest` fixtures.
## License
`mimesis_factory` is released under the MIT License.
%package -n python3-mimesis-factory
Summary: Mimesis integration with factory_boy
Provides: python-mimesis-factory
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-mimesis-factory
## mimesis_factory
[](https://travis-ci.com/mimesis-lab/mimesis-factory)
[](https://coveralls.io/github/mimesis-lab/mimesis-factory?branch=master)
[](https://badge.fury.io/py/mimesis-factory) [](https://github.com/wemake-services/wemake-python-styleguide)
## Description
[Mimesis](https://github.com/lk-geimfari/mimesis) integration for [`factory_boy`](https://github.com/FactoryBoy/factory_boy).
## Installation
```python
➜ pip install mimesis_factory
```
## Usage
Look at the example below and you’ll understand how it works:
```python
class Account(object):
def __init__(self, username, email, name, surname, age):
self.username = username
self.email = email
self.name = name
self.surname = surname
self.age = age
```
Now, use the `MimesisField` class from `mimesis_factory`
to define how fake data is generated:
```python
import factory
from mimesis_factory import MimesisField
from account import Account
class AccountFactory(factory.Factory):
class Meta(object):
model = Account
username = MimesisField('username', template='l_d')
name = MimesisField('name', gender='female')
surname = MimesisField('surname', gender='female')
age = MimesisField('age', minimum=18, maximum=90)
email = factory.LazyAttribute(
lambda instance: '{0}@example.org'.format(instance.username)
)
access_token = MimesisField('token', entropy=32)
```
## pytest
We also recommend to use [`pytest-factoryboy`](https://github.com/pytest-dev/pytest-factoryboy).
This way it will be possible to integrate your factories into `pytest` fixtures.
## License
`mimesis_factory` is released under the MIT License.
%package help
Summary: Development documents and examples for mimesis-factory
Provides: python3-mimesis-factory-doc
%description help
## mimesis_factory
[](https://travis-ci.com/mimesis-lab/mimesis-factory)
[](https://coveralls.io/github/mimesis-lab/mimesis-factory?branch=master)
[](https://badge.fury.io/py/mimesis-factory) [](https://github.com/wemake-services/wemake-python-styleguide)
## Description
[Mimesis](https://github.com/lk-geimfari/mimesis) integration for [`factory_boy`](https://github.com/FactoryBoy/factory_boy).
## Installation
```python
➜ pip install mimesis_factory
```
## Usage
Look at the example below and you’ll understand how it works:
```python
class Account(object):
def __init__(self, username, email, name, surname, age):
self.username = username
self.email = email
self.name = name
self.surname = surname
self.age = age
```
Now, use the `MimesisField` class from `mimesis_factory`
to define how fake data is generated:
```python
import factory
from mimesis_factory import MimesisField
from account import Account
class AccountFactory(factory.Factory):
class Meta(object):
model = Account
username = MimesisField('username', template='l_d')
name = MimesisField('name', gender='female')
surname = MimesisField('surname', gender='female')
age = MimesisField('age', minimum=18, maximum=90)
email = factory.LazyAttribute(
lambda instance: '{0}@example.org'.format(instance.username)
)
access_token = MimesisField('token', entropy=32)
```
## pytest
We also recommend to use [`pytest-factoryboy`](https://github.com/pytest-dev/pytest-factoryboy).
This way it will be possible to integrate your factories into `pytest` fixtures.
## License
`mimesis_factory` is released under the MIT License.
%prep
%autosetup -n mimesis_factory-1.2.0
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-mimesis-factory -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Thu Jun 08 2023 Python_Bot - 1.2.0-1
- Package Spec generated