<s> import datetime <EOL> import factory <EOL> from django . utils import timezone <EOL> from . models import JobType , JobCategory , Job <EOL> next_month = timezone . now ( ) + datetime . timedelta ( days = <NUM_LIT:30> ) <EOL> class JobCategoryFactory ( factory . DjangoModelFactory ) : <EOL> class Meta : <EOL> model = JobCategory <EOL> django_get_or_create = ( '<STR_LIT:name>' , ) <EOL> name = factory . Sequence ( lambda n : '<STR_LIT>' . format ( n ) ) <EOL> class JobTypeFactory ( factory . DjangoModelFactory ) : <EOL> class Meta : <EOL> model = JobType <EOL> django_get_or_create = ( '<STR_LIT:name>' , ) <EOL> name = factory . Sequence ( lambda n : '<STR_LIT>' . format ( n ) ) <EOL> class JobFactory ( factory . DjangoModelFactory ) : <EOL> class Meta : <EOL> model = Job <EOL> category = factory . SubFactory ( JobCategoryFactory ) <EOL> job_title = factory . Sequence ( lambda n : '<STR_LIT>' . format ( n ) ) <EOL> city = '<STR_LIT>' <EOL> region = '<STR_LIT>' <EOL> country = '<STR_LIT>' <EOL> company_name = factory . Sequence ( lambda n : '<STR_LIT>' . format ( n ) ) <EOL> company_description = factory . Sequence ( lambda n : '<STR_LIT>' . format ( n ) ) <EOL> contact = '<STR_LIT>' <EOL> email = factory . Sequence ( lambda n : '<STR_LIT>' . format ( n ) ) <EOL> description = '<STR_LIT>' <EOL> requirements = '<STR_LIT>' <EOL> expires = next_month <EOL> @ factory . post_generation <EOL> def job_types ( self , create , extracted , ** kwargs ) : <EOL> if not create : <EOL> return <EOL> if extracted : <EOL> for job_type in extracted : <EOL> self . job_types . add ( job_type ) <EOL> class ApprovedJobFactory ( JobFactory ) : <EOL> status = Job . STATUS_APPROVED <EOL> class ArchivedJobFactory ( JobFactory ) : <EOL> status = Job . STATUS_ARCHIVED <EOL> class DraftJobFactory ( JobFactory ) : <EOL> status = Job . STATUS_DRAFT <EOL> class ExpiredJobFactory ( JobFactory ) : <EOL> status = Job . STATUS_EXPIRED <EOL> class RejectedJobFactory ( JobFactory ) : <EOL> status = Job . STATUS_REJECTED <EOL> class RemovedJobFactory ( JobFactory ) : <EOL> status = Job . STATUS_REMOVED <EOL> class ReviewJobFactory ( JobFactory ) : <EOL> status = Job . STATUS_REVIEW </s>
