def test_room_to_share(self): daft = Daft() daft.set_county('Dublin') daft.set_area('Castleknock') daft.set_listing_type(RentType.ROOMS_TO_SHARE) daft.set_furnished(True) daft.set_min_price(500) daft.set_max_price(1000) daft.set_room_type(RoomType.DOUBLE) listings = daft.search() self.assertTrue(len(listings) > 0)
def test_room_to_share(self): daft = Daft() daft.set_county("Dublin") daft.set_listing_type(RentType.ROOMS_TO_SHARE) daft.set_with_photos(True) daft.set_ensuite_only(True) daft.set_furnished(True) daft.set_num_occupants(2) daft.set_min_price(500) daft.set_max_price(1000) daft.set_room_type(RoomType.DOUBLE) listings = daft.search(fetch_all=False) self.assertTrue(len(listings) > 0)
def initialize_daft_api_client(): daft_client = Daft() daft_client.set_county(config.COUNTY) daft_client.set_listing_type(config.LISTING_TYPE) daft_client.set_min_price(config.MIN_PRICE) daft_client.set_max_price(config.MAX_PRICE) daft_client.set_with_photos(config.WITH_PHOTOS) daft_client.set_added_since(config.ADDED_SINCE) daft_client.set_area(config.AREAS) daft_client.set_sort_order(config.SORT_ORDER) daft_client.set_sort_by(config.SORT_BY) daft_client.set_furnished(config.FURNISHED) daft_client.set_min_beds(config.MIN_BEDS) daft_client.set_min_lease(config.MIN_LEASE) return daft_client
from daftlistings import Daft, RentType, RoomType, Gender daft = Daft() daft.set_listing_type(RentType.ROOMS_TO_SHARE) daft.set_room_type(RoomType.DOUBLE) daft.set_furnished(True) daft.set_county("Dublin City") daft.set_area("Castleknock") daft.set_gender(Gender.MALE) daft.set_with_photos(True) listings = daft.search() for listing in listings: print(listing.price) print(listing.formalised_address) print(listing.daft_link) print(listing.contact_number) print(" ")