from factory import Faker
from factory.django import DjangoModelFactory, ImageField
from factory.faker import faker
from mdgen import MarkdownPostProvider

from jobya.companies.models import Company

fake = faker.Faker()
fake.add_provider(MarkdownPostProvider)


class CompanyFactory(DjangoModelFactory):
    class Meta:
        model = Company
        database = "default"
        django_get_or_create = ("name",)

    name = Faker("company")
    website = Faker("domain_name")
    email = Faker("company_email")
    phone = Faker("phone_number")
    overview = Faker("text", max_nb_chars=3000)
    logo = ImageField(color="blue", width=84, height=84, format="PNG")
    is_verfied = Faker("pybool")
