Exemple #1
0
def import_city():
"""
runs city import every minute 
"""
	city_uri = 'city.csv'  

	data = get_remote_content(URL+city_uri, USERNAME, PASSWORD)
	save_city(data)
Exemple #2
0
	def store_city(self):
		"""
		Store cities from csv in base
		"""

		file_uri = self.city_csv_uri
		data = get_remote_content(self.url+file_uri, self.username, self.password)
		csv_city = data['data']

		save_city(csv_city)
		total_new_cities = City.objects.all().count()
		
		self.assertEqual(total_new_cities, 6)
Exemple #3
0
    def store_city(self):
        """
		Store cities from csv in base
		"""

        file_uri = self.city_csv_uri
        data = get_remote_content(self.url + file_uri, self.username,
                                  self.password)
        csv_city = data['data']

        save_city(csv_city)
        total_new_cities = City.objects.all().count()

        self.assertEqual(total_new_cities, 6)