Example #1
0
	def setUp(self):
		user=User(username="******",email="*****@*****.**")
		user.set_password("haslo123")
		user.is_admin=False
		user.is_active=True
		user.is_customer=True
		user.save()
		user.customer.birth_date=datetime.date(1997,10,1)
		user.customer.money=500.0
		user.customer.save()		
Example #2
0
 def setUp(self):
     bet = Bet(teama="barcelona",
               teamb="real",
               oddsa=2.00,
               oddsx=3.20,
               oddsb=2.50,
               game_date="2020-02-21",
               category="11")
     bet.save()
     bettwo = Bet(teama="polska",
                  teamb="anglia",
                  oddsa=1.50,
                  oddsb=2.50,
                  game_date="2020-02-21",
                  category="11")
     bettwo.save()
     user = User(username="******", email="*****@*****.**")
     user.set_password("haslo123")
     user.is_admin = False
     user.is_active = True
     user.is_customer = True
     user.save()
     user.customer.birth_date = datetime.date(1997, 10, 1)
     user.customer.money = 500.0
     user.customer.save()
     placedbet = PlacedBet(pick="1")
     placedbet.save()
     placedbet = PlacedBet.objects.get(pk=1)
     placedbet.bet_id.add(bet)
     placedbet.save()
     placedbettwo = PlacedBet(pick="1")
     placedbettwo.save()
     placedbettwo.bet_id.add(bettwo)
     placedbettwo.save()
     coupon = Coupon(user=user, stake=20, is_placed=True, status=None)
     coupon.save()
     coupon.placedbets.add(placedbet)
     coupon.placedbets.add(placedbettwo)
     coupon.save()