Esempio n. 1
0
	def setUp(self):
		newco = Company()
		
		#start by creating the required fields
		
		#name
		newco.name = "SuperStartup"
		#permalink
		newco.permalink = "superstartup"
		#category_code
		newco.category_code ="software"
		#number of employees
		newco.number_of_employees = 3
		#founded year
		newco.founded_year = 2001
		#founded_month
		newco.founded_month = None
		#deadpooled_year
		newco.deadpooled_year = None
		#deadpooled_month
		newco.deadpooled_month = None
		#deadpooled_url
		#newco.deadpooled_url = ''
		
		#description
		newco.description = "newco makes widgets that automate productivity of efficient social features in the health, retail, industry, banking, telecommunications, construction and small business accounting industries"
		#overview
		newco.overview = "We are revolution to market"
		#total_money_raised
		newco.total_money_raised = "\u20ac183M"
		
		#save to database before adding manytomanyfields
		newco.save()
		
		#adding ManyToManyField values
		#ipo
		ipo1 = ipo()
		ipo1.save()
		newco.ipo.add(ipo1)
		
		#tag_list
		tag1 = tag(tag = "venture-capital-company")
		tag1.save()
		tag2 = tag(tag = "disruptive-technology-start-ups")
		tag2.save()
		
		newco.tag_list.add(tag1)
		newco.tag_list.add(tag2)

		#funding rounds
		#financial organization
		financial1 = financial_org()
		financial1.name = "Open Ocean"
		financial1.permalink = "openocean"
		financial1.save()
		#investment
		investment1 = investments()
		investment1.save()
		investment1.financial_org.add(financial1)
		
		#round
		round1 = funding_rounds()
		round1.round_code = "a"
		round1.raised_amount = 21640000 
		round1.raised_currency_code = "EUR"
		round1.funded_year = 2008 
		round1.funded_month = 10 
		round1.funded_day = 30 
		round1.save()
		print("Saved the easy funding round...")
		round1.investments.add(investment1)
		
		#Add the funding round
		newco.funding_rounds.add(round1)