Exemple #1
0
def import_hotel():
"""
runs hotel import every two minutes 
"""
	hotel_uri = 'hotel.csv'
	
	data = get_remote_content(URL+hotel_uri, USERNAME, PASSWORD)
	save_hotel(data)
Exemple #2
0
	def store_hotel(self):
		"""
		Store hotel from csv in base	
		"""
		
		# first get the cities 
		self.store_city()

		file_uri = self.hotel_csv_uri
		data = get_remote_content(self.url+file_uri, self.username, self.password)

		hotel_csv = data['data']
		save_hotel(hotel_csv)
		total_new_hotels = Hotel.objects.all().count()

		self.assertEqual(total_new_hotels, 196)
Exemple #3
0
    def store_hotel(self):
        """
		Store hotel from csv in base	
		"""

        # first get the cities
        self.store_city()

        file_uri = self.hotel_csv_uri
        data = get_remote_content(self.url + file_uri, self.username,
                                  self.password)

        hotel_csv = data['data']
        save_hotel(hotel_csv)
        total_new_hotels = Hotel.objects.all().count()

        self.assertEqual(total_new_hotels, 196)