# Path: accounts/factories.py
# class UserFactory(factory.DjangoModelFactory):
#     username = factory.Sequence(lambda n: 'admin%d' % n)
#     password = 'secret'
#     email = factory.LazyAttribute(lambda obj: '%s@example.com' % obj.username)
# 
#     class Meta:
#         model = User
# 
#     @classmethod
#     def _create(cls, model_class, *args, **kwargs):
#         manager = cls._get_manager(model_class)
#         return manager.create_user(*args, **kwargs)
# 
# Path: books/models.py
# class Transaction(models.Model):
# class DebtLoan(models.Model):
#     EXPENSE = 'exp'
#     INCOME = 'inc'
#     CATEGORY_CHOICES = (
#         (EXPENSE, 'expense'),
#         (INCOME, 'income'),
#     )
#     DEBT = 0
#     LOAN = 1
#     CATEGORY_CHOICES = (
#         (DEBT, 'debt'),
#         (LOAN, 'loan'),
#     )
#     def __str__(self):
#     def deactivate(self):
#     def __str__(self):
#     def deactivate(self):


import factory
from accounts.factories import UserFactory
from books import models



class TransactionFactory(factory.DjangoModelFactory):
    title = factory.Sequence(lambda n: 'transaction_%d' % n)
    amount = 10

# Path: accounts/factories.py
# class UserFactory(factory.DjangoModelFactory):
#     username = factory.Sequence(lambda n: 'admin%d' % n)
#     password = 'secret'
#     email = factory.LazyAttribute(lambda obj: '%s@example.com' % obj.username)
# 
#     class Meta:
#         model = User
# 
#     @classmethod
#     def _create(cls, model_class, *args, **kwargs):
#         manager = cls._get_manager(model_class)
#         return manager.create_user(*args, **kwargs)
# 
# Path: books/models.py
# class Transaction(models.Model):
# class DebtLoan(models.Model):
#     EXPENSE = 'exp'
#     INCOME = 'inc'
#     CATEGORY_CHOICES = (
#         (EXPENSE, 'expense'),
#         (INCOME, 'income'),
#     )
#     DEBT = 0
#     LOAN = 1
#     CATEGORY_CHOICES = (
#         (DEBT, 'debt'),
#         (LOAN, 'loan'),
#     )
#     def __str__(self):
#     def deactivate(self):
#     def __str__(self):
#     def deactivate(self):


# Path: books/factories.py
import factory
from accounts.factories import UserFactory
from books import models




class TransactionFactory(factory.DjangoModelFactory):
    title = factory.Sequence(lambda n: 'transaction_%d' % n)
    amount = 10

    category = models.Transaction.EXPENSE