<commit_before>import factory
from bongo.apps.bongo import models
from django.contrib.auth.models import User
from random import choice, sample
from string import lowercase, digits, capitalize, lowercase

class UserFactory(factory.Factory):
    class Meta:
        model = User

    first_name = capitalize(''.join(choice(lowercase) for i in range(6)))
    last_name = capitalize(''.join(choice(lowercase) for i in range(7)))
    username = factory.LazyAttribute(lambda obj: obj.first_name[0] + obj.last_name)
    email = factory.LazyAttribute(lambda obj: obj.username + "@bowdoin.edu")
    password = factory.PostGenerationMethodCall('set_password',
                                                '<PASSWORD>')

class JobFactory(factory.Factory):
    class Meta:
        model = models.Job

    title = choice(["Editor in Chief", "Opinion Editor", "Contributor", "Staff Writer", "Columnist"])

class CreatorFactory(factory.Factory):
    class Meta:
        model = models.Creator

    user = factory.SubFactory(UserFactory)
    name = capitalize(''.join(choice(lowercase) for i in range(6)))
    job = factory.SubFactory(JobFactory)
    twitter = "@"+''.join(choice(lowercase) for i in range(8))

class TextFactory(factory.Factory):
    class Meta:
        model = models.Text

    caption = factory.Sequence(lambda n: 'This is text #{0}'.format(n))
    body = "It has a loooooooooooooong body"
    excerpt = "The excerpt isn't correct until it's saved"

class VideoFactory(factory.Factory):
    class Meta:
        model = models.Video

    caption = factory.Sequence(lambda n: 'This is video #{0}'.format(n))
    host = choice(["Vimeo", "YouTube", "Vine"])
    uid = ''.join(choice(lowercase + digits) for i in range(15))

class PDFFactory(factory.Factory):
    class Meta:
        model = models.PDF

    caption = factory.Sequence(lambda n: 'This is pdf #{0}'.format(n))

class PhotoFactory(factory.Factory):
    class Meta:
        model = models.Photo

    caption = factory.Sequence(lambda n: 'This is photo #{0}'.format(n))

class HTMLFactory(factory.Factory):
    class Meta:
        model = models.HTML

    caption = factory.Sequence(lambda n: 'This is html #{0}'.format(n))
    content = "<h1>wooo html</h1>"

class PullquoteFactory(factory.Factory):
    class Meta:
        model = models.Pullquote

    caption = factory.Sequence(lambda n: 'This is pullquote #{0}'.format(n))
    quote = "Success is my only motherfuckin' option, failure's not"
    attribution = "<NAME>, TDD evangelist"

class SeriesFactory(factory.Factory):
    pass

class IssueFactory(factory.Factory):
    pass

class VolumeFactory(factory.Factory):
    pass

class SectionFactory(factory.Factory):
    pass

class TagFactory(factory.Factory):
    pass

class PostFactory(factory.Factory):
    pass<commit_msg>jokez<commit_after>import factory
from bongo.apps.bongo import models
from django.contrib.auth.models import User
from random import choice, sample
from string import lowercase, digits, capitalize

class UserFactory(factory.Factory):
    class Meta:
        model = User

    first_name = capitalize(''.join(choice(lowercase) for i in range(6)))
    last_name = capitalize(''.join(choice(lowercase) for i in range(7)))
    username = factory.LazyAttribute(lambda obj: (obj.first_name[0] + obj.last_name).lower())
    email = factory.LazyAttribute(lambda obj: (obj.username + "@bowdoin.edu").lower())
    password = factory.PostGenerationMethodCall('set_password',
                                                '<PASSWORD>')

class JobFactory(factory.Factory):
    class Meta:
        model = models.Job

    title = choice(["Editor in Chief", "Opinion Editor", "Contributor", "Staff Writer", "Columnist"])

class CreatorFactory(factory.Factory):
    class Meta:
        model = models.Creator

    user = factory.SubFactory(UserFactory)
    name = capitalize(''.join(choice(lowercase) for i in range(6)))
    job = factory.SubFactory(JobFactory)
    twitter = "@"+''.join(choice(lowercase) for i in range(8))

class TextFactory(factory.Factory):
    class Meta:
        model = models.Text

    caption = factory.Sequence(lambda n: 'This is text #{0}'.format(n))
    body = "It has a loooooooooooooong body"
    excerpt = "The excerpt isn't correct until it's saved"

class VideoFactory(factory.Factory):
    class Meta:
        model = models.Video

    caption = factory.Sequence(lambda n: 'This is video #{0}'.format(n))
    host = choice(["Vimeo", "YouTube", "Vine"])
    uid = ''.join(choice(lowercase + digits) for i in range(15))

class PDFFactory(factory.Factory):
    class Meta:
        model = models.PDF

    caption = factory.Sequence(lambda n: 'This is pdf #{0}'.format(n))

class PhotoFactory(factory.Factory):
    class Meta:
        model = models.Photo

    caption = factory.Sequence(lambda n: 'This is photo #{0}'.format(n))

class HTMLFactory(factory.Factory):
    class Meta:
        model = models.HTML

    caption = factory.Sequence(lambda n: 'This is html #{0}'.format(n))
    content = "<script type='text/javascript'>alert('lol xss');</script>"

class PullquoteFactory(factory.Factory):
    class Meta:
        model = models.Pullquote

    caption = factory.Sequence(lambda n: 'This is pullquote #{0}'.format(n))
    quote = "Success is my only motherfuckin' option, failure's not"
    attribution = "<NAME>, TDD evangelist"

class SeriesFactory(factory.Factory):
    class Meta:
        model = models.Series

    name = factory.Sequence(lambda n: 'super punny series name #{0}'.format(n))

class IssueFactory(factory.Factory):
    pass

class VolumeFactory(factory.Factory):
    pass

class SectionFactory(factory.Factory):
    pass

class TagFactory(factory.Factory):
    pass

class PostFactory(factory.Factory):
    pass
{'fraction_non_alphanumeric': 0.12304483837330553, 'fraction_numerical': 0.005039972193256865, 'mean_word_length': 3.5710881652104844, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2345892', 'n_tokens_mistral': 1722, 'n_tokens_neox': 1662, 'n_words': 466}