legacy/pairent_backend/pairent_app/factories.py

55 lines
1.7 KiB
Python
Raw Normal View History

2023-05-05 13:03:33 +02:00
import factory
from pairent_app.models import Apartament
2023-05-05 14:08:27 +02:00
factory.Faker.override_default_locale('ru_RU');
2023-05-05 13:03:33 +02:00
class ApartmentFactory(factory.django.DjangoModelFactory):
class Meta:
model = Apartament
# Base data
2023-05-05 14:08:27 +02:00
price = factory.Faker('random_number')
2023-05-05 13:03:33 +02:00
lastPrice = price
2023-05-05 14:08:27 +02:00
bail = factory.Faker('random_number')
2023-05-05 13:03:33 +02:00
2023-05-05 14:08:27 +02:00
agencyCommission = factory.Faker('random_number')
utilitiesPrice = factory.Faker('random_number')
minimumLeasePeriod = factory.Faker('random_number')
2023-05-05 13:03:33 +02:00
2023-05-05 14:08:27 +02:00
address = factory.Faker('address')
description = factory.Faker('sentence')
2023-05-05 13:03:33 +02:00
2023-05-05 14:08:27 +02:00
perimetrs = factory.Faker('random_number')
rooms = factory.Faker('random_number')
ceilingHeight = factory.Faker('random_number')
floorHouse = factory.Faker('random_number')
floor = factory.Faker('random_number')
2023-05-05 13:03:33 +02:00
2023-05-05 14:08:27 +02:00
phoneNumber = factory.Faker('phone_number')
2023-05-05 13:03:33 +02:00
2023-05-05 14:08:27 +02:00
timeToBus = factory.Faker('random_number')
timeToTrain = factory.Faker('random_number')
2023-05-05 13:03:33 +02:00
# Apartment props
2023-05-05 14:08:27 +02:00
isFurniture = factory.Faker('boolean')
isAnimal = factory.Faker('boolean')
isTelevision = factory.Faker('boolean')
isChild = factory.Faker('boolean')
isInternet = factory.Faker('boolean')
isBathroom = factory.Faker('boolean')
isRefrigerator = factory.Faker('boolean')
isWasher = factory.Faker('boolean')
isAirConditioning = factory.Faker('boolean')
isFreshRepair = factory.Faker('boolean')
2023-05-05 13:03:33 +02:00
# House props
2023-05-05 14:08:27 +02:00
isElevator = factory.Faker('boolean')
isParking = factory.Faker('boolean')
isGarbageChute = factory.Faker('boolean')
isConcierge = factory.Faker('boolean')
2023-05-05 13:03:33 +02:00
2023-05-05 14:08:27 +02:00
views = factory.Faker('random_number')
2023-05-05 13:03:33 +02:00
2023-05-05 14:08:27 +02:00
dateCreate = factory.Faker('date')