<s> from django . contrib . auth . models import User <EOL> import factory <EOL> from tickets . models import Ticket , TicketComment <EOL> class UserFactory ( factory . DjangoModelFactory ) : <EOL> FACTORY_FOR = User <EOL> username = factory . Sequence ( lambda n : "<STR_LIT>" % n ) <EOL> class TicketFactory ( factory . DjangoModelFactory ) : <EOL> FACTORY_FOR = Ticket <EOL> creator = factory . LazyAttribute ( lambda a : UserFactory ( ) ) <EOL> class TicketCommentFactory ( factory . DjangoModelFactory ) : <EOL> FACTORY_FOR = TicketComment <EOL> ticket = factory . LazyAttribute ( lambda a : TicketFactory ( ) ) <EOL> author = factory . LazyAttribute ( lambda a : UserFactory ( ) ) </s>
