# Path: apps/subscribers/tests/factories.py
# class TicketFactory(factory.django.DjangoModelFactory):
#     class Meta:
#         model = Ticket
# 
# Path: apps/subscribers/models.py
# class Ticket(models.Model):
#     twid = models.CharField(blank=True, max_length=40)
#     name = models.CharField(max_length=200)
#     display_name = models.CharField(blank=True, max_length=200)
#     created = models.DateTimeField(default=timezone.now)
#     updated = models.DateTimeField(default=timezone.now)
# 
#     # Store the months if there's a substreak (defaults to 1 month).
#     streak = models.IntegerField(default=1)
# 
#     # Is this subscription active?
#     is_active = models.BooleanField(default=True,
#         help_text='Is this subscription active?')
#     is_paid = models.BooleanField(default=True,
#         help_text='Is this a paid subscription? (e.g., Not a bot.)')
# 
#     # Custom manager.
#     objects = TicketManager()
# 
#     class Meta:
#         ordering = ['updated']
#         get_latest_by = 'updated'
# 
#     def __str__(self):
#         return '{}'.format(self.name)
# 
#     def update(self, **kwargs):
#         allowed_attributes = {'twid', 'display_name', 'updated', 'is_active'}
#         for name, value in kwargs.items():
#             assert name in allowed_attributes
#             setattr(self, name, value)
#         self.save()


import pytest
from .factories import TicketFactory
from ..models import Ticket
# -*- coding: utf-8 -*-


pytestmark = pytest.mark.django_db


def test_ticket_factory():
    factory = TicketFactory()

# Path: apps/subscribers/tests/factories.py
# class TicketFactory(factory.django.DjangoModelFactory):
#     class Meta:
#         model = Ticket
# 
# Path: apps/subscribers/models.py
# class Ticket(models.Model):
#     twid = models.CharField(blank=True, max_length=40)
#     name = models.CharField(max_length=200)
#     display_name = models.CharField(blank=True, max_length=200)
#     created = models.DateTimeField(default=timezone.now)
#     updated = models.DateTimeField(default=timezone.now)
# 
#     # Store the months if there's a substreak (defaults to 1 month).
#     streak = models.IntegerField(default=1)
# 
#     # Is this subscription active?
#     is_active = models.BooleanField(default=True,
#         help_text='Is this subscription active?')
#     is_paid = models.BooleanField(default=True,
#         help_text='Is this a paid subscription? (e.g., Not a bot.)')
# 
#     # Custom manager.
#     objects = TicketManager()
# 
#     class Meta:
#         ordering = ['updated']
#         get_latest_by = 'updated'
# 
#     def __str__(self):
#         return '{}'.format(self.name)
# 
#     def update(self, **kwargs):
#         allowed_attributes = {'twid', 'display_name', 'updated', 'is_active'}
#         for name, value in kwargs.items():
#             assert name in allowed_attributes
#             setattr(self, name, value)
#         self.save()


# Path: apps/subscribers/tests/test_factories.py
import pytest
from .factories import TicketFactory
from ..models import Ticket

# -*- coding: utf-8 -*-


pytestmark = pytest.mark.django_db


def test_ticket_factory():
    factory = TicketFactory()

    assert isinstance(factory, Ticket)