Coverage for src/auth/factories.py: 100%

1 from faker import Faker

2 from polyfactory.factories.sqlalchemy_factory import SQLAlchemyFactory

3 from polyfactory.fields import Use

4

5 from .models import PermissionModel, RoleModel, UserModel

6

7 faker = Faker()

8

9

10 class UserFactory(SQLAlchemyFactory[UserModel]):

11 email = Use(faker.unique.email)

12

13

14 class RoleFactory(SQLAlchemyFactory[RoleModel]):

15 name = Use(faker.unique.word)

16

17

18 class PermissionFactory(SQLAlchemyFactory[PermissionModel]):

19 name = Use(faker.unique.word)