Beispiel #1
0
    def setUpClass(cls):
        super(TournamentTestCase, cls).setUpClass()

        Account.objects.create(id=37, battle_tag='ADMIN', account_id='99999')
        for i in range(0, cls.players):
            Account.objects.create_user(id_generator(),
                                        random.randint(100000, 999999))
        cls.new_tour = Tournament.create('All',
                                         'Semi',
                                         'Finals',
                                         fare=10,
                                         name='Name',
                                         maxplayers=12,
                                         rules='Rules',
                                         date='2015-01-01',
                                         format='SE',
                                         time='15:00',
                                         account=Account.objects.last(),
                                         background='',
                                         region='Europe')
        cls.client = APIClient()

        accounts = Account.objects.all()
        for acc in accounts:
            new_attendant = Attendant(account=acc,
                                      tournament=cls.new_tour,
                                      gameClass='rus.png')
            new_attendant.save()
Beispiel #2
0
    def setUpClass(cls):
        super(TournamentTestCase, cls).setUpClass()

        Account.objects.create(id=37, battle_tag='ADMIN', account_id='99999')
        for i in range(0, cls.players):
            Account.objects.create_user(id_generator(), random.randint(100000, 999999))
        cls.new_tour = Tournament.create('All', 'Semi', 'Finals', fare=10, name='Name', maxplayers=12, rules='Rules',
                                         date='2015-01-01', format='SE',
                                         time='15:00', account=Account.objects.last(), background='', region='Europe')
        cls.client = APIClient()

        accounts = Account.objects.all()
        for acc in accounts:
            new_attendant = Attendant(account=acc, tournament=cls.new_tour, gameClass='rus.png')
            new_attendant.save()
Beispiel #3
0
 def create(self, validated_data):
     new_tournament = Tournament.create(name=validated_data['name'],
                                        allmatches=validated_data['allmatches'],
                                        semi=validated_data['semi'],
                                        finals=validated_data['finals'],
                                        maxplayers=validated_data['maxplayers'],
                                        rules=validated_data['rules'],
                                        date=validated_data['date'],
                                        time=validated_data['time'],
                                        fare=validated_data['fare'],
                                        account=self.context['request'].user,
                                        # account=28,
                                        format=validated_data['format'],
                                        background=validated_data['background'],
                                        region=validated_data['region'])
     return new_tournament