def test_apartments_to_let(self): daft = Daft() daft.set_county("Dublin") daft.set_couples_accepted(True) daft.set_with_photos(True) daft.set_ensuite_only(True) daft.set_area_type(AreaType.TRANSPORT_ROUTE) daft.set_public_transport_route(TransportRoute.DART) daft.set_listing_type(RentType.APARTMENTS) daft.set_added_since(7) daft.set_gender(Gender.EITHER) listings = daft.search() self.assertTrue(len(listings) > 0)
def test_apartments_to_let(self): daft = Daft() daft.set_listing_type(RentType.APARTMENTS) daft.set_area_type(AreaType.ENROUTE) daft.set_public_transport_route(TransportRoute.BUS_LINE_15) daft.set_min_lease(6) daft.set_max_lease(12) daft.set_offset(3) daft.set_sort_order(SortOrder.DESCENDING) daft.set_gender(Gender.EITHER) daft.set_availability(12) daft.set_pets_allowed(True) daft.set_keywords("Furnished") daft.set_couples_accepted(True) listings = daft.search(fetch_all=False) search_count = daft.search_count self.assertGreater(search_count, 0) self.assertGreater(len(listings), 0) apartment = listings[0] self.assertIsNotNone(apartment.commercial_area_size) self.assertIsNotNone(apartment.contact_number) self.assertIsNotNone(apartment.daft_link) self.assertIsNotNone(apartment.date_insert_update) self.assertIsNotNone(apartment.dwelling_type) self.assertIsNotNone(apartment.facilities) self.assertIsNotNone(apartment.formalised_address) self.assertIsNotNone(apartment.id) self.assertIsNotNone(apartment.bathrooms) self.assertIsNotNone(apartment.bedrooms) self.assertIsNotNone(apartment.overviews) self.assertIsNotNone(apartment.price) self.assertIsNotNone(apartment.search_type) self.assertIsNotNone(apartment.shortcode) self.assertIsNotNone(apartment.views) self.assertIsNotNone(apartment.features) self.assertIsNotNone(apartment.description) self.assertIsNotNone(apartment.advertiser_name) self.assertIsNotNone(apartment.agent) self.assertIsNotNone(apartment.agent_url) self.assertIsNotNone(apartment.ber_code) self.assertIsNotNone(apartment.city_center_distance) self.assertIsNotNone(apartment.date_insert_update) self.assertIsNotNone(apartment.hires_images)