Example #1
0
class QueueFactory(factory.django.DjangoModelFactory):
    class Meta:
        model = Queue

    name = fuzzy.FuzzyText()
Example #2
0
class LanguageFactory(factory.DjangoModelFactory):
    name = fuzzy.FuzzyText()

    class Meta:
        model = models.Language
        django_get_or_create = ('name',)
Example #3
0
class RelatedUrlFactory(factory.DjangoModelFactory):
    video = factory.SubFactory(VideoFactory)
    url = fuzzy.FuzzyText(prefix='http://', length=20, suffix='.com')

    class Meta:
        model = models.RelatedUrl
Example #4
0
class BootScriptFactory(factory.DjangoModelFactory):
    class Meta:
        model = BootScript

    title = fuzzy.FuzzyText(prefix="bootscript-title-")
    created_by = factory.SubFactory(UserFactory)
Example #5
0
class SpeakerFactory(factory.DjangoModelFactory):
    name = fuzzy.FuzzyText()
    slug = factory.LazyAttribute(lambda o: text_type(slugify(o.name)))

    class Meta:
        model = models.Speaker
class ConditionFactory(factory.django.DjangoModelFactory):
    condition = fuzzy.FuzzyText(length=50)

    class Meta:
        model = models.Condition
Example #7
0
class ProductTypeFactory(DjangoModelFactory):
    class Meta:
        model = ProductType

    identifier = factory.Sequence(lambda n: 'type_%d' % n)
    name = fuzzy.FuzzyText(length=6, prefix="Product Type ")
Example #8
0
class NoteFactory(factory.DjangoModelFactory):
    class Meta:
        model = Note

    body = fuzzy.FuzzyText()
Example #9
0
class EquipmentTypeFactory(factory.django.DjangoModelFactory):
    class Meta:
        model = EquipmentType

    name = fuzzy.FuzzyText(length=15)
    rate = 1.0
Example #10
0
class PublicsBusinessRegionFactory(factory.DjangoModelFactory):
    name = fuzzy.FuzzyText(length=8)
    code = fuzzy.FuzzyText(length=2)

    class Meta:
        model = models.BusinessRegion
Example #11
0
class PublicsTravelExpenseTypeFactory(factory.DjangoModelFactory):
    title = fuzzy.FuzzyText(length=12)
    vendor_number = fuzzy.FuzzyText(length=12)

    class Meta:
        model = models.TravelExpenseType
Example #12
0
class AdvertFactory(factory.django.DjangoModelFactory):
    class Meta:
        model = Advert

    url = factory.Sequence(lambda n: f"Person {n}")
    text = fuzzy.FuzzyText()
Example #13
0
class ExpansionFactory(factory.django.DjangoModelFactory):
    class Meta:
        model = models.Expansion

    name = fuzzy.FuzzyText(length=6, prefix='Expansion_')
Example #14
0
class NatuurlijkePersoonFactory(factory.DjangoModelFactory):
    class Meta:
        model = models.NatuurlijkPersoon

    id = fuzzy.FuzzyInteger(low=10000000000000, high=19000009999999)
    voornamen = fuzzy.FuzzyText('voornaam')
class ClassificationFactory(factory.django.DjangoModelFactory):
    classification = fuzzy.FuzzyText(length=50)

    class Meta:
        model = models.Classification
class CFDAProgramFactory(factory.Factory):
    class Meta:
        model = domainModels.CFDAProgram

    cfda_program_id = None
    program_number = fuzzy.FuzzyDecimal(0, 99, 3)
    program_title = fuzzy.FuzzyText()
    popular_name = fuzzy.FuzzyText()
    federal_agency = fuzzy.FuzzyText()
    authorization = fuzzy.FuzzyText()
    objectives = fuzzy.FuzzyText()
    types_of_assistance = fuzzy.FuzzyText()
    uses_and_use_restrictions = fuzzy.FuzzyText()
    applicant_eligibility = fuzzy.FuzzyText()
    beneficiary_eligibility = fuzzy.FuzzyText()
    credentials_documentation = fuzzy.FuzzyText()
    preapplication_coordination = fuzzy.FuzzyText()
    application_procedures = fuzzy.FuzzyText()
    award_procedure = fuzzy.FuzzyText()
    deadlines = fuzzy.FuzzyText()
    range_of_approval_disapproval_time = fuzzy.FuzzyText()
    website_address = fuzzy.FuzzyText()
    formula_and_matching_requirements = fuzzy.FuzzyText()
    length_and_time_phasing_of_assistance = fuzzy.FuzzyText()
    reports = fuzzy.FuzzyText()
    audits = fuzzy.FuzzyText()
    records = fuzzy.FuzzyText()
    account_identification = fuzzy.FuzzyText()
    obligations = fuzzy.FuzzyText()
    range_and_average_of_financial_assistance = fuzzy.FuzzyText()
    appeals = fuzzy.FuzzyText()
    renewals = fuzzy.FuzzyText()
    program_accomplishments = fuzzy.FuzzyText()
    regulations_guidelines_and_literature = fuzzy.FuzzyText()
    regional_or_local_office = fuzzy.FuzzyText()
    headquarters_office = fuzzy.FuzzyText()
    related_programs = fuzzy.FuzzyText()
    examples_of_funded_projects = fuzzy.FuzzyText()
    criteria_for_selecting_proposals = fuzzy.FuzzyText()
    url = fuzzy.FuzzyText()
    recovery = fuzzy.FuzzyText()
    omb_agency_code = fuzzy.FuzzyText()
    omb_bureau_code = fuzzy.FuzzyText()
    published_date = fuzzy.FuzzyText()
    archived_date = fuzzy.FuzzyText()
class LocationFactory(factory.django.DjangoModelFactory):
    location = fuzzy.FuzzyText(length=50)

    class Meta:
        model = models.Location
Example #18
0
class SpecialReportingRequirementFactory(factory.django.DjangoModelFactory):
    class Meta:
        model = models.SpecialReportingRequirement

    due_date = fuzzy.FuzzyDate(datetime.date(2001, 1, 1))
    description = fuzzy.FuzzyText(length=50)
class DesignerFactory(factory.django.DjangoModelFactory):
    designer = fuzzy.FuzzyText(length=100)

    class Meta:
        model = models.Designer
Example #20
0
class IndicatorFactory(factory.django.DjangoModelFactory):
    class Meta:
        model = models.Indicator

    name = factory.Sequence(lambda n: 'Indicator {}'.format(n))
    code = fuzzy.FuzzyText(length=5)
Example #21
0
class SalesUnitFactory(DjangoModelFactory):
    class Meta:
        model = SalesUnit

    name = fuzzy.FuzzyText(length=12, prefix="Sales Unit ")
    symbol = fuzzy.FuzzyText(length=6, prefix="SU ")
Example #22
0
class StateFactory(DjangoModelFactory):
    name = fuzzy.FuzzyText()

    class Meta:
        model = State
Example #23
0
class CategoryFactory(factory.DjangoModelFactory):
    title = fuzzy.FuzzyText()
    slug = factory.LazyAttribute(lambda o: text_type(slugify(o.title)))

    class Meta:
        model = models.Category
Example #24
0
class EventFactory(factory.django.DjangoModelFactory):
    class Meta:
        model = Event

    name = fuzzy.FuzzyText(length=50, prefix='event-')
    slug = fuzzy.FuzzyText(length=50)
    dtype = factory.SubFactory(DisasterTypeFactory)

    @factory.post_generation
    def districts(self, create, extracted, **kwargs):
        if not create:
            return

        if extracted:
            for district in extracted:
                self.districts.add(district)

    @factory.post_generation
    def countries(self, create, extracted, **kwargs):
        if not create:
            return

        if extracted:
            for country in extracted:
                self.countries.add(country)

    @factory.post_generation
    def regions(self, create, extracted, **kwargs):
        if not create:
            return

        if extracted:
            for region in extracted:
                self.regions.add(region)

    parent_event = factory.SubFactory("api.factories.event.EventFactory",
                                      parent_event=None)

    summary = fuzzy.FuzzyText(length=500)

    num_injured = fuzzy.FuzzyInteger(0)
    num_dead = fuzzy.FuzzyInteger(0)
    num_missing = fuzzy.FuzzyInteger(0)
    num_affected = fuzzy.FuzzyInteger(0)
    num_displaced = fuzzy.FuzzyInteger(0)

    ifrc_severity_level = fuzzy.FuzzyChoice(AlertLevel)
    glide = fuzzy.FuzzyText(length=18)

    disaster_start_date = fuzzy.FuzzyDateTime(
        datetime.datetime(2008, 1, 1, tzinfo=pytz.utc))
    created_at = fuzzy.FuzzyDateTime(
        datetime.datetime(2008, 1, 1, tzinfo=pytz.utc))
    updated_at = fuzzy.FuzzyDateTime(
        datetime.datetime(2008, 1, 1, tzinfo=pytz.utc))
    previous_update = fuzzy.FuzzyDateTime(
        datetime.datetime(2008, 1, 1, tzinfo=pytz.utc))

    auto_generated = fuzzy.FuzzyChoice([True, False])
    auto_generated_source = fuzzy.FuzzyText(length=50)

    is_featured = fuzzy.FuzzyChoice([True, False])
    is_featured_region = fuzzy.FuzzyChoice([True, False])

    hide_attached_field_reports = fuzzy.FuzzyChoice([True, False])
    hide_field_report_map = fuzzy.FuzzyChoice([True, False])

    tab_one_title = fuzzy.FuzzyText(length=50)
    tab_two_title = fuzzy.FuzzyText(length=50)
    tab_three_title = fuzzy.FuzzyText(length=50)
    visibility = 3
Example #25
0
class TagFactory(factory.DjangoModelFactory):
    tag = fuzzy.FuzzyText()

    class Meta:
        model = models.Tag
Example #26
0
class BackingInstanceFactory(DjangoModelFactory):
    """Factory for BackingInstance"""
    instance_url = fuzzy.FuzzyText(prefix="http://")

    class Meta:  # pylint: disable=missing-docstring,no-init,too-few-public-methods,old-style-class
        model = BackingInstance
Example #27
0
class VideoFactory(factory.DjangoModelFactory):
    title = fuzzy.FuzzyText()
    category = factory.SubFactory(CategoryFactory)

    class Meta:
        model = models.Video
class LabelFactory(factory.django.DjangoModelFactory):
    label = fuzzy.FuzzyText(length=200)

    class Meta:
        model = models.Label
Example #29
0
class StoredSignalFilterFactory(factory.DjangoModelFactory):
    name = fuzzy.FuzzyText(length=100)

    class Meta:
        model = StoredSignalFilter
Example #30
0
class ProductFactory(DjangoModelFactory):
    name = fuzzy.FuzzyText()
    unit_price = fuzzy.FuzzyDecimal(1, 200)

    class Meta:
        model = models.Product