import factory

from symposion.schedule.tests.factories import ConferenceFactory
from symposion.sponsorship.models import SponsorLevel, Sponsor


class SponsorLevelFactory(factory.django.DjangoModelFactory):
    conference = factory.SubFactory(ConferenceFactory)
    name = factory.Faker("color_name")
    order = factory.Faker("pyint")
    cost = factory.Faker("pyint")
    description = factory.Faker("paragraph")

    class Meta:
        model = SponsorLevel


class SponsorFactory(factory.django.DjangoModelFactory):
    name = factory.Faker("company")
    display_url = factory.Faker("uri")
    external_url = factory.Faker("uri")
    contact_name = factory.Faker("name")
    contact_email = factory.Faker("company_email")
    level = factory.SubFactory(SponsorLevelFactory)

    class Meta:
        model = Sponsor

import factory

from symposion.schedule.tests.factories import ConferenceFactory
from symposion.sponsorship.models import SponsorLevel, Sponsor


class SponsorLevelFactory(factory.django.DjangoModelFactory):
    conference = factory.SubFactory(ConferenceFactory)
    name = factory.Faker("color_name")
    order = factory.Faker("pyint")
    cost = factory.Faker("pyint")
    description = factory.Faker("paragraph")

    class Meta:
        model = SponsorLevel


class SponsorFactory(factory.django.DjangoModelFactory):
    name = factory.Faker("company")
    display_url = factory.Faker("uri")
    external_url = factory.Faker("uri")
    contact_name = factory.Faker("name")
    contact_email = factory.Faker("company_email")
    level = factory.SubFactory(SponsorLevelFactory)
    active = factory.Faker("boolean")

    class Meta:
        model = Sponsor

Allow SponsorFactory to create active sponsors.
Allow SponsorFactory to create active sponsors.

  import factory
  
  from symposion.schedule.tests.factories import ConferenceFactory
  from symposion.sponsorship.models import SponsorLevel, Sponsor
  
  
  class SponsorLevelFactory(factory.django.DjangoModelFactory):
      conference = factory.SubFactory(ConferenceFactory)
      name = factory.Faker("color_name")
      order = factory.Faker("pyint")
      cost = factory.Faker("pyint")
      description = factory.Faker("paragraph")
  
      class Meta:
          model = SponsorLevel
  
  
  class SponsorFactory(factory.django.DjangoModelFactory):
      name = factory.Faker("company")
      display_url = factory.Faker("uri")
      external_url = factory.Faker("uri")
      contact_name = factory.Faker("name")
      contact_email = factory.Faker("company_email")
      level = factory.SubFactory(SponsorLevelFactory)
+     active = factory.Faker("boolean")
  
      class Meta:
          model = Sponsor
  
Allow SponsorFactory to create active sponsors.
## Code Before:
import factory

from symposion.schedule.tests.factories import ConferenceFactory
from symposion.sponsorship.models import SponsorLevel, Sponsor


class SponsorLevelFactory(factory.django.DjangoModelFactory):
    conference = factory.SubFactory(ConferenceFactory)
    name = factory.Faker("color_name")
    order = factory.Faker("pyint")
    cost = factory.Faker("pyint")
    description = factory.Faker("paragraph")

    class Meta:
        model = SponsorLevel


class SponsorFactory(factory.django.DjangoModelFactory):
    name = factory.Faker("company")
    display_url = factory.Faker("uri")
    external_url = factory.Faker("uri")
    contact_name = factory.Faker("name")
    contact_email = factory.Faker("company_email")
    level = factory.SubFactory(SponsorLevelFactory)

    class Meta:
        model = Sponsor

## Instruction:
Allow SponsorFactory to create active sponsors.
## Code After:
import factory

from symposion.schedule.tests.factories import ConferenceFactory
from symposion.sponsorship.models import SponsorLevel, Sponsor


class SponsorLevelFactory(factory.django.DjangoModelFactory):
    conference = factory.SubFactory(ConferenceFactory)
    name = factory.Faker("color_name")
    order = factory.Faker("pyint")
    cost = factory.Faker("pyint")
    description = factory.Faker("paragraph")

    class Meta:
        model = SponsorLevel


class SponsorFactory(factory.django.DjangoModelFactory):
    name = factory.Faker("company")
    display_url = factory.Faker("uri")
    external_url = factory.Faker("uri")
    contact_name = factory.Faker("name")
    contact_email = factory.Faker("company_email")
    level = factory.SubFactory(SponsorLevelFactory)
    active = factory.Faker("boolean")

    class Meta:
        model = Sponsor
