Ejemplo n.º 1
0
    def setUp(self):
        #first user
        first_user = User.objects.create(username='******')
        first_user.set_password('1234')
        first_user.email = '*****@*****.**'
        first_user.save()

        #second user
        second_user = User.objects.create(username='******')
        second_user.set_password('1234')
        second_user.email = '*****@*****.**'
        second_user.save()

        #set up league
        league = League(name='league',
                        owner=first_user,
                        created_date=timezone.now(),
                        signup_code="ehh")
        league.save()
        league.participants.add(first_user)
        league.participants.add(second_user)
        league.save()
        self.league = league

        #first team with players
        first_team = Team(team_name='jabs',
                          team_owner_id=first_user.id,
                          created_date=timezone.now(),
                          league=self.league)
        first_team.save()
        first_player = UserPlayer(player_team=first_team,
                                  player_first_name='joe',
                                  player_last_name='momma',
                                  league=league)
        first_player.save()

        #second team with players
        second_team = Team(team_name='jabronis',
                           team_owner_id=second_user.id,
                           created_date=timezone.now(),
                           league=self.league)
        second_team.save()
        second_player = UserPlayer(player_team=second_team,
                                   player_first_name='joseph',
                                   player_last_name='momma',
                                   league=league)
        second_player.save()

        #make the trade sucka!
        new_trade = Trade(proposing_team=first_team,
                          receiving_team=second_team,
                          created_date=timezone.now())
        new_trade.save()
        new_trade.proposing_team_players.add(first_player)
        new_trade.receiving_team_players.add(second_player)
        new_trade.save()
        self.trade = new_trade
Ejemplo n.º 2
0
 def set_up_league(self):
     league = League(name='league',
                     owner=self.user,
                     created_date=timezone.now(),
                     signup_code="ehh")
     league.save()
     league.participants.add(self.user)
     league.save()
     self.league = league
Ejemplo n.º 3
0
 def setUp(self):
     user = User(username='******', password='******')
     user.save()
     self.user = user
     league = League(name='league',
                     owner=user,
                     created_date=timezone.now(),
                     signup_code="ehh")
     league.save()
     league.participants.add(user)
     league.save()
     self.league = league
Ejemplo n.º 4
0
 def setUp(self):
     user = User.objects.create(username='******')
     user.set_password('1234')
     user.email = '*****@*****.**'
     user.save()
     self.new_user = user
     league = League(name='league',
                     owner=user,
                     created_date=timezone.now(),
                     signup_code="ehh")
     league.save()
     league.participants.add(user)
     league.save()
     self.league = league
Ejemplo n.º 5
0
 def setUp(self):
     user = User.objects.create(username='******')
     user.set_password('1234')
     user.save()
     self.new_user = user
     self.login_user()
     self.team_index = self.client.get('/cloud_roni/')
     league = League(name='league',
                     owner=user,
                     created_date=timezone.now(),
                     signup_code="ehh")
     league.save()
     league.participants.add(user)
     league.save()
     self.league = league
Ejemplo n.º 6
0
 def setUp(self):
     user = User(username='******', password='******')
     user.save()
     self.user = user
     league = League(name='league',
                     owner=user,
                     created_date=timezone.now(),
                     signup_code="ehh")
     league.save()
     league.participants.add(user)
     league.save()
     self.league = league
     team = Team(created_date=timezone.now(),
                 id=1,
                 team_owner=self.user,
                 league=self.league)
     player = UserPlayer(player_team=team, id=1, league=self.league)
     self.team = team
     self.player = player
Ejemplo n.º 7
0
 def set_up_endable_league(self):
     for i in range(0, 3):
         user = User.objects.create(username='******' + str(i))
         user.set_password('1234')
         user.email = '*****@*****.**'
         user.save()
     users = User.objects.all()
     league = League(name='endable_league',
                     owner=User.objects.get(username='******'),
                     created_date=timezone.now(),
                     signup_code="ehh")
     league.save()
     for idx, user in enumerate(users):
         league.participants.add(user)
         league.save()
         team = Team(team_name=str(user),
                     created_date=timezone.now(),
                     team_owner=user,
                     team_points=idx,
                     league=league)
         team.save()
Ejemplo n.º 8
0
    def setUp(self):
        user = User(username='******')
        user.set_password('rabble')
        user.save()
        self.user = user
        league = League(name='league',
                        owner=user,
                        created_date=timezone.now(),
                        signup_code="ehh")
        league.save()
        league.participants.add(user)
        league.save()
        self.league = league

        #second user
        second_user = User.objects.create(username='******')
        second_user.set_password('1234')
        second_user.save()

        #third user
        third_user = User.objects.create(username='******')
        third_user.set_password('1234')
        third_user.save()

        #set up league for new users
        league.participants.add(second_user)
        league.participants.add(third_user)
        league.save()

        #first team with players
        first_team = Team(team_name='jabs',
                          team_owner_id=user.id,
                          created_date=timezone.now(),
                          league=self.league)
        first_team.save()
        self.first_team = first_team

        #second team with players
        second_team = Team(team_name='jabronis',
                           team_owner_id=second_user.id,
                           created_date=timezone.now(),
                           league=self.league)
        second_team.save()
        self.second_team = second_team

        #second team with players
        third_team = Team(team_name='asdf',
                          team_owner_id=third_user.id,
                          created_date=timezone.now(),
                          league=self.league)
        third_team.save()