class DispensingSizeFactory(factory.DjangoModelFactory): class Meta: model = DispensingSize name = factory.Sequence(lambda x: "Unit %d" % x)
class GovDepartmentFactory(factory.django.DjangoModelFactory): name = factory.Sequence(lambda n: f"GovDepartment{n}") email_domains = factory.Sequence(lambda n: [f"department{n}.gov.uk"]) class Meta: model = "accounts.GovDepartment"
class ConditionalOfferFactory(BaseConditionalOfferFactory): # pylint: disable=function-redefined name = factory.Sequence( lambda n: 'ConditionalOffer {number}'.format(number=n))
class AgencyFactory(NodeFactory): name = factory.Sequence(lambda n: 'agency-%s' % n) typeOf = factory.SubFactory(AgencyTypeFactory)
class TutorFactory(factory.DjangoModelFactory): class Meta: model = 'base.Tutor' external_id = factory.Sequence(lambda n: '10000000%02d' % n) person = factory.SubFactory(PersonFactory)
class UserFactory(factory.django.DjangoModelFactory): class Meta: model = User username = factory.Sequence(lambda n: "user{}".format(n)) email = factory.Sequence(lambda n: "user{}@example.com".format(n))
class PatientFactory(factory.django.DjangoModelFactory): class Meta: model = Patient name = factory.Sequence(lambda n: f"Patient {n}")
class CityFactory(factory.DjangoModelFactory): class Meta: model = City name = factory.Sequence(lambda x: "City %d" % x) country = factory.SubFactory(CountryFactory)
class ProductTypeFactory(DjangoModelFactory): class Meta: model = ProductType identifier = factory.Sequence(lambda n: 'type_%d' % n) name = fuzzy.FuzzyText(length=6, prefix="Product Type ")
class PaymentTermsFactory(factory.DjangoModelFactory): class Meta: model = PaymentTerms name = factory.Sequence(lambda x: f"Payment Term %d" % x)
class CountryFactory(factory.DjangoModelFactory): class Meta: model = Country name = factory.Sequence(lambda x: "Country %d" % x)
class TierFactory(factory.DjangoModelFactory): class Meta: model = Tier name = factory.Sequence(lambda x: f"Tier %d" % x)
class PromotionTypeFactory(factory.DjangoModelFactory): class Meta: model = PromotionType name = factory.Sequence(lambda x: "Promotion Type %d" % x)
class ProductCategoryFactory(factory.DjangoModelFactory): class Meta: model = ProductCategory name = factory.Sequence(lambda x: "Category %d" % x)
class AbstractBaseFactory(factory.django.DjangoModelFactory): class Meta: model = models.AbstractBase abstract = True foo = factory.Sequence(lambda n: "foo%d" % n)
class TagFactory(factory.Factory): FACTORY_FOR = Tag name = factory.Sequence(lambda n: 'tag_{}'.format(n))
class BodegaFactory(factory.django.DjangoModelFactory): class Meta: model = Bodega nombre = factory.Sequence(lambda n: 'nombre bodega %d' % n) es_principal = False
class GroupFactory(factory.django.DjangoModelFactory): name = factory.Sequence(lambda n: '{}-{}'.format(str(n), faker.job())) class Meta: model = Group
class PhotoFactory(factory.django.DjangoModelFactory): class Meta: model = Photo title = factory.Sequence(lambda n: "photo title {}".format(n)) description = factory.Sequence(lambda n: "some_photo_description")
class InstanceActionFactory(DjangoModelFactory): class Meta: model = InstanceAction name = factory.Sequence(lambda n: "action-%s" % n) description = factory.Sequence(lambda n: "Description for action %s" % n)
class DepartmentFactory(NodeFactory): name = factory.Sequence(lambda n: 'department-%s' % n) typeOf = factory.SubFactory(DepartmentTypeFactory)
class WithCustomManagerFactory(factory.django.DjangoModelFactory): class Meta: model = models.WithCustomManager foo = factory.Sequence(lambda n: "foo%d" % n)
class ServiceFactory(NodeFactory): parent = factory.SubFactory(AgencyWithDepartmentFactory) name = factory.Sequence(lambda n: 'service-%s' % n) typeOf = factory.SubFactory(ServiceTypeFactory)
class ExampleFactory(factory.django.DjangoModelFactory): class Meta: model = 'djapp.StandardModel' foo = factory.Sequence(lambda n: n)
class StyleFactory(factory.django.DjangoModelFactory): name = factory.Sequence(lambda n: 'style %d' % n) class Meta: model = Style
class StandardFactory(factory.django.DjangoModelFactory): class Meta: model = models.StandardModel foo = factory.Sequence(lambda n: "foo%d" % n)
class VoucherFactory(BaseVoucherFactory): # pylint: disable=function-redefined name = factory.Faker('word') code = factory.Sequence(lambda n: 'VOUCHERCODE{number}'.format(number=n))
class NonIntegerPkFactory(factory.django.DjangoModelFactory): class Meta: model = models.NonIntegerPk foo = factory.Sequence(lambda n: "foo%d" % n) bar = ''
class DonorCodeT1Factory(factory.DjangoModelFactory): FACTORY_FOR = 'catalog.DonorCode' code = factory.Sequence(lambda n: 'donor-code-%s' % n) donor_code_type = DonorCode.T1
class OutletKindFactory(factory.DjangoModelFactory): class Meta: model = OutletKind name = factory.Sequence(lambda x: "Outlet Kind %d" % x)