# Path: wh_habitica/models.py
# class Habitica(models.Model):
#     """
#     Habitica API Endpoint
#     """
# 
#     user_id = models.CharField(_('User ID'), max_length=255, blank=True)
#     name = models.CharField(_('Name'), max_length=255, blank=True)
#     email = models.EmailField(_('Email'), blank=True)
#     api_token = models.CharField(_('API Token'), max_length=255, blank=True)
#     owner = models.OneToOneField(settings.AUTH_USER_MODEL, related_name='habitica')
# 
#     created_at = models.DateTimeField(_("Created at"), auto_now_add=True)
#     modified_at = models.DateTimeField(_("Modified at"), auto_now=True)
# 
#     def get_api(self):
#         """
#         Returns the Habitica API object.
#         """
# 
#         return HabiticaApi(self.user_id, self.api_token)
# 
#     class Meta:
#         db_table = 'habitica_habitica'
# 
# Path: wunderhabit/factories.py
# class UserFactory(factory.django.DjangoModelFactory):
#     class Meta:
#         model = get_user_model()
# 
#     username = factory.Sequence(lambda n: "user_%d" % n)
#     first_name = 'John'
#     last_name = 'Doe'


import factory
from django.utils.crypto import get_random_string
from .models import Habitica
from wunderhabit.factories import UserFactory




class HabiticaFactory(factory.django.DjangoModelFactory):
    class Meta:
        model = Habitica

    user_id = factory.Sequence(lambda n: "%d" % n)
    name = 'John'
    email = 'john@doe.com'

# Path: wh_habitica/models.py
# class Habitica(models.Model):
#     """
#     Habitica API Endpoint
#     """
# 
#     user_id = models.CharField(_('User ID'), max_length=255, blank=True)
#     name = models.CharField(_('Name'), max_length=255, blank=True)
#     email = models.EmailField(_('Email'), blank=True)
#     api_token = models.CharField(_('API Token'), max_length=255, blank=True)
#     owner = models.OneToOneField(settings.AUTH_USER_MODEL, related_name='habitica')
# 
#     created_at = models.DateTimeField(_("Created at"), auto_now_add=True)
#     modified_at = models.DateTimeField(_("Modified at"), auto_now=True)
# 
#     def get_api(self):
#         """
#         Returns the Habitica API object.
#         """
# 
#         return HabiticaApi(self.user_id, self.api_token)
# 
#     class Meta:
#         db_table = 'habitica_habitica'
# 
# Path: wunderhabit/factories.py
# class UserFactory(factory.django.DjangoModelFactory):
#     class Meta:
#         model = get_user_model()
# 
#     username = factory.Sequence(lambda n: "user_%d" % n)
#     first_name = 'John'
#     last_name = 'Doe'


# Path: wh_habitica/factories.py
import factory
from django.utils.crypto import get_random_string
from .models import Habitica
from wunderhabit.factories import UserFactory





class HabiticaFactory(factory.django.DjangoModelFactory):
    class Meta:
        model = Habitica

    user_id = factory.Sequence(lambda n: "%d" % n)
    name = 'John'
    email = 'john@doe.com'

    api_token = get_random_string(32)