def setUp(self):
        super(RouteDivisionMachineTD, self).setUp()
        response, results = self.dispatch_request('/%s/util/healthcheck' %
                                                  self.poop_db_name)
        self.flask_app = self.app.instances[self.poop_db_name]
        self.admin_user, self.scorekeeper_user, self.desk_user = orm_creation.create_stanard_roles_and_users(
            self.flask_app)
        self.admin_user_password = '******'
        self.desk_user_password = '******'
        self.machine = self.flask_app.tables.Machine(
            machine_name='test_machine', abbreviation='AAAA')
        self.machine_2 = self.flask_app.tables.Machine(
            machine_name='test_machine_2', abbreviation='BBBB')
        self.flask_app.tables.db_handle.session.add(self.machine)
        self.flask_app.tables.db_handle.session.add(self.machine_2)
        self.flask_app.tables.db_handle.session.commit()
        self.new_tournament = orm_creation.create_tournament(
            self.flask_app, {
                'tournament_name': 'test_tournament_1',
                'single_division': True,
                'finals_num_qualifiers': '24',
                'scoring_type': "HERB",
                'team_tournament': False,
                'local_price': '5',
                'use_stripe': False
            })
        self.new_team_tournament = orm_creation.create_tournament(
            self.flask_app, {
                'tournament_name': 'test_tournament_2',
                'single_division': True,
                'finals_num_qualifiers': '24',
                'scoring_type': "HERB",
                'team_tournament': True,
                'local_price': '5',
                'use_stripe': False
            })

        self.new_player = orm_creation.create_player(self.flask_app, {
            'first_name': 'test',
            'last_name': 'player',
            'ifpa_ranking': '123'
        })
        self.new_player_pin = self.new_player.pin
        self.new_player_2 = orm_creation.create_player(self.flask_app, {
            'first_name': 'test',
            'last_name': 'player_2',
            'ifpa_ranking': '123'
        })
        self.new_team = orm_creation.create_team(self.flask_app, {
            'team_name': 'test_team',
            'players': ['1', '2']
        })
        self.new_team_2 = orm_creation.create_team(self.flask_app, {
            'team_name': 'test_team_2',
            'players': ['1', '2']
        })
    def setUp(self):
        super(RouteAuditLogTD, self).setUp()
        response, results = self.dispatch_request('/%s/util/healthcheck' %
                                                  self.poop_db_name)
        self.flask_app = self.app.instances[self.poop_db_name]
        self.admin_user, self.scorekeeper_user, self.desk_user = orm_creation.create_stanard_roles_and_users(
            self.flask_app)
        #FIXME : password/username should be passed in to create_roles_and_users()
        self.score_user_name_password = '******'
        self.admin_user_name_password = '******'
        db_util.load_machines_from_json(self.flask_app, True)
        orm_creation.init_papa_tournaments_divisions(self.flask_app)
        self.player = orm_creation.create_player(
            self.flask_app, {
                'first_name': 'test',
                'last_name': 'player',
                'ifpa_ranking': '123',
                'linked_division_id': '1'
            })
        self.player_pin = self.player.pin
        self.player_two = orm_creation.create_player(
            self.flask_app, {
                'first_name': 'test',
                'last_name': 'player_2',
                'ifpa_ranking': '123',
                'linked_division_id': '1'
            })
        self.machine = self.flask_app.tables.Machine.query.filter_by(
            machine_id=1).first()
        self.division = self.flask_app.tables.Division.query.filter_by(
            division_id=1).first()
        self.team_division = self.flask_app.tables.Division.query.filter_by(
            team_tournament=True).first()
        self.division_machine = orm_creation.create_division_machine(
            self.flask_app, self.machine, self.division)
        self.division_machines = []
        machine_id = 1
        for division in self.flask_app.tables.Division.query.all():
            machine_id = machine_id + 1
            self.new_machine = self.flask_app.tables.Machine.query.filter_by(
                machine_id=machine_id).first()
            self.division_machines.append(
                orm_creation.create_division_machine(self.flask_app,
                                                     self.new_machine,
                                                     division))

        self.team_division_machine = orm_creation.create_division_machine(
            self.flask_app, self.machine, self.team_division)
 def setUp(self):
     super(RouteQueueTD,self).setUp()
     response,results = self.dispatch_request('/%s/util/healthcheck' % self.poop_db_name)                
     self.flask_app = self.app.instances[self.poop_db_name]
     self.admin_user, self.scorekeeper_user,self.desk_user = orm_creation.create_stanard_roles_and_users(self.flask_app)
     #FIXME : password/username should be passed in to create_roles_and_users()
     self.score_user_name_password='******'                
     db_util.load_machines_from_json(self.flask_app,True)
     orm_creation.init_papa_tournaments_divisions(self.flask_app)
     self.player = orm_creation.create_player(self.flask_app,{'first_name':'test','last_name':'player','ifpa_ranking':'123','linked_division_id':'1'})
     self.player_two = orm_creation.create_player(self.flask_app,{'first_name':'test_two','last_name':'player_two','ifpa_ranking':'321','linked_division_id':'1'})        
     self.player_three = orm_creation.create_player(self.flask_app,{'first_name':'test_three','last_name':'player_three','ifpa_ranking':'444','linked_division_id':'1'})
     self.player_four = orm_creation.create_player(self.flask_app,{'first_name':'test_three','last_name':'player_four','ifpa_ranking':'555','linked_division_id':'1'})        
     self.machine = self.flask_app.tables.Machine.query.filter_by(machine_id=1).first()
     self.division = self.flask_app.tables.Division.query.filter_by(division_id=1).first()
     self.division_machine = orm_creation.create_division_machine(self.flask_app,self.machine,self.division)
     self.division_machine_2 = orm_creation.create_division_machine(self.flask_app,self.machine,self.division)
 def test_edit_with_player_permissions(self):
     self.new_player = orm_creation.create_player(self.flask_app, {
         'first_name': 'aiton',
         'last_name': 'goldman',
         'ifpa_ranking': '123'
     })
     with self.flask_app.test_client() as c:
         self.checkWrongPermissions(c,
                                    'put',
                                    '/player/1',
                                    pin=self.new_player.pin)
    def setUp(self):
        super(RouteFinalsTD, self).setUp()
        response, results = self.dispatch_request('/%s/util/healthcheck' %
                                                  self.poop_db_name)
        self.flask_app = self.app.instances[self.poop_db_name]
        self.admin_user, self.scorekeeper_user, self.desk_user = orm_creation.create_stanard_roles_and_users(
            self.flask_app)
        #FIXME : password/username should be passed in to create_roles_and_users()
        self.score_user_name_password = '******'
        self.admin_user_name_password = '******'
        db_util.load_machines_from_json(self.flask_app, True)
        orm_creation.init_papa_tournaments_divisions(self.flask_app)

        self.machine = self.flask_app.tables.Machine.query.filter_by(
            machine_id=1).first()
        self.division_machines = []
        self.team_division_machines = []

        self.players = []
        self.teams = []
        self.flask_app.tables.db_handle.session.commit()
        for i in range(100, 140):
            self.players.append(
                orm_creation.create_player(
                    self.flask_app, {
                        'first_name': 'test',
                        'last_name': 'player%s' % i,
                        'ifpa_ranking': '123',
                        'linked_division_id': '1'
                    }))
        for i in range(100, 110):
            for division in self.flask_app.tables.Division.query.filter_by(
                    team_tournament=False).all():
                self.division_machines.append(
                    orm_creation.create_division_machine(
                        self.flask_app, self.machine, division))
            for division in self.flask_app.tables.Division.query.filter_by(
                    team_tournament=True).all():
                self.team_division_machines.append(
                    orm_creation.create_division_machine(
                        self.flask_app, self.machine, division))

        self.division = self.flask_app.tables.Division.query.filter_by(
            team_tournament=False).all()[0]
        self.team_division = self.flask_app.tables.Division.query.filter_by(
            team_tournament=True).all()[0]

        for i in range(100, 110, 2):
            self.teams.append(
                orm_creation.create_team(
                    self.flask_app, {
                        'team_name': 'test_team_%s' % i,
                        'players': ['%s' % i, '%s' % (i + 1)]
                    }))
Beispiel #6
0
    def setUp(self):
        super(RouteStripeTD, self).setUp()
        response, results = self.dispatch_request('/%s/util/healthcheck' %
                                                  self.poop_db_name)
        self.flask_app = self.app.instances[self.poop_db_name]
        self.admin_user, self.scorekeeper_user, self.desk_user = orm_creation.create_stanard_roles_and_users(
            self.flask_app)

        db_util.load_machines_from_json(self.flask_app, True)
        #FIXME : This should be passed in from env variables?
        orm_creation.init_papa_tournaments_divisions(
            self.flask_app,
            use_stripe=True,
            stripe_sku=[
                "sku_8bY4j0VdBxGmPu", "sku_8zGvY92kgyMlx1",
                "sku_8cVf2tetzJ4f8D", "sku_8beHMnaBSdH4NA",
                "sku_8beJOPdNmnoQgw", "sku_8beFqmlhh0y6Wa",
                "sku_8bU4ZwvW1UMtxy", "sku_9jugzXV5S8oafx",
                "sku_9juhywxXYAFfW7"
            ])
        self.player = orm_creation.create_player(
            self.flask_app, {
                'first_name': 'test',
                'last_name': 'player',
                'ifpa_ranking': '123',
                'linked_division_id': '1'
            })
        self.player_pin = self.player.pin
        self.player_two = orm_creation.create_player(
            self.flask_app, {
                'first_name': 'test_two',
                'last_name': 'player_two',
                'ifpa_ranking': '321',
                'linked_division_id': '1'
            })
        orm_creation.create_team(self.flask_app, {
            'team_name': 'test_team',
            'players': ['1', '2']
        })
Beispiel #7
0
    def setUp(self):
        super(RouteTokenTD, self).setUp()
        response, results = self.dispatch_request('/%s/util/healthcheck' %
                                                  self.poop_db_name)
        self.flask_app = self.app.instances[self.poop_db_name]
        self.admin_user, self.scorekeeper_user, self.desk_user = orm_creation.create_stanard_roles_and_users(
            self.flask_app)

        db_util.load_machines_from_json(self.flask_app, True)
        orm_creation.init_papa_tournaments_divisions(self.flask_app)
        self.player = orm_creation.create_player(
            self.flask_app, {
                'first_name': 'test',
                'last_name': 'player',
                'ifpa_ranking': '123',
                'linked_division_id': '1'
            })
        self.player_id = self.player.player_id
        self.player_pin = self.player.pin
        self.player_two = orm_creation.create_player(
            self.flask_app, {
                'first_name': 'test_two',
                'last_name': 'player_two',
                'ifpa_ranking': '321',
                'linked_division_id': '1'
            })
        self.player_two_id = self.player_two.player_id

        self.team = orm_creation.create_team(
            self.flask_app, {
                'team_name':
                'test_team',
                'players':
                [str(self.player.player_id),
                 str(self.player_two.player_id)]
            })
        self.team_id = self.team.team_id
Beispiel #8
0
 def setUp(self):
     super(RouteTournamentTD, self).setUp()
     response, results = self.dispatch_request('/%s/util/healthcheck' %
                                               self.poop_db_name)
     self.flask_app = self.app.instances[self.poop_db_name]
     self.admin_user, self.scorekeeper_user, self.desk_user = orm_creation.create_stanard_roles_and_users(
         self.flask_app)
     self.admin_user_password = '******'
     self.desk_user_password = '******'
     self.new_player = orm_creation.create_player(self.flask_app, {
         'first_name': 'aiton',
         'last_name': 'goldman',
         'ifpa_ranking': '123'
     })
     self.player_pin = self.new_player.pin
 def test_get_player_on_machine(self):
     self.new_player = orm_creation.create_player(self.flask_app, {
         'first_name': 'aiton',
         'last_name': 'goldman',
         'ifpa_ranking': '123'
     })
     self.division_machine.player_id = 1
     self.flask_app.tables.db_handle.session.commit()
     with self.flask_app.test_client() as c:
         rv = c.get('/player/1')
         self.assertEquals(
             rv.status_code, 200,
             'Was expecting status code 200, but it was %s : %s' %
             (rv.status_code, rv.data))
         returned_player = json.loads(rv.data)['data']
         self.assertEquals(
             returned_player['division_machine']['division_machine_name'],
             'test_machine')
    def test_get_player_on_team(self):
        self.new_player = orm_creation.create_player(self.flask_app, {
            'first_name': 'aiton',
            'last_name': 'goldman',
            'ifpa_ranking': '123'
        })
        self.new_team = orm_creation.create_team(self.flask_app, {
            'team_name': 'test_team',
            'players': ['1']
        })

        with self.flask_app.test_client() as c:
            rv = c.get('/player/1')
            self.assertEquals(
                rv.status_code, 200,
                'Was expecting status code 200, but it was %s : %s' %
                (rv.status_code, rv.data))
            returned_player = json.loads(rv.data)['data']

            self.assertEquals(returned_player['teams'][0]['team_name'],
                              'test_team')
    def setUp(self):
        super(RouteUserTD, self).setUp()
        response, results = self.dispatch_request('/%s/util/healthcheck' %
                                                  self.poop_db_name)
        self.flask_app = self.app.instances[self.poop_db_name]
        orm_creation.create_stanard_roles_and_users(self.flask_app)
        self.new_player = orm_creation.create_player(self.flask_app, {
            'first_name': 'aiton',
            'last_name': 'goldman',
            'ifpa_ranking': '123'
        })

        # self.new_role = self.flask_app.tables.Role(name='test_role')
        # self.flask_app.tables.db_handle.session.add(self.new_role)
        # self.flask_app.tables.db_handle.session.commit()

        # self.new_role_id = self.new_role.role_id

        # self.new_role_2 = self.flask_app.tables.Role(name='test_role_2')
        # self.flask_app.tables.db_handle.session.add(self.new_role_2)
        # self.flask_app.tables.db_handle.session.commit()

        # self.new_role_2_id = self.new_role_2.role_id

        # self.admin_role = self.flask_app.tables.Role(name='admin')
        # self.flask_app.tables.db_handle.session.add(self.admin_role)
        # self.flask_app.tables.db_handle.session.commit()

        # self.admin_role_id = self.admin_role.role_id

        # self.admin_user = self.flask_app.tables.User(username='******')
        # self.admin_user.crypt_password('test_admin')
        # self.admin_user.roles.append(self.admin_role)
        # self.flask_app.tables.db_handle.session.add(self.admin_user)
        # self.flask_app.tables.db_handle.session.commit()
        self.admin_user_name = 'test_admin'
        self.admin_user_password = '******'
        self.player_pin = self.new_player.pin
Beispiel #12
0
 def setUp(self):
     super(RouteAuthTD,self).setUp()
     response,results = self.dispatch_request('/%s/util/healthcheck' % self.poop_db_name)                
     self.flask_app = self.app.instances[self.poop_db_name]
     orm_creation.create_stanard_roles_and_users(self.flask_app)
     self.new_player = orm_creation.create_player(self.flask_app,{'first_name':'aiton','last_name':'goldman','ifpa_ranking':'123'})        
Beispiel #13
0
 def setUp(self):
     super(SetupAddToMachineTD, self).setUp()
     response, results = self.dispatch_request('/%s/util/healthcheck' %
                                               self.poop_db_name)
     self.flask_app = self.app.instances[self.poop_db_name]
     self.admin_user, self.scorekeeper_user, self.desk_user = orm_creation.create_stanard_roles_and_users(
         self.flask_app)
     db_util.load_machines_from_json(self.flask_app, False)
     stripe_skus = {
         'A': 'main_a_1',
         'B': 'main_b_1',
         'C': 'main_c_1',
         'D': 'main_d_1',
         'Split Flipper': 'split_1',
         'Classics 1': 'classics_1',
         'Classics 2': 'classics_1',
         'Classics 3': 'classics_1',
         'Classics Meta': 'classics_1'
     }
     discount_stripe_skus = {
         'A': 'main_a_3',
         'B': 'main_b_3',
         'C': 'main_c_3',
         'Split Flipper': 'split_3',
         'Classics Meta': 'classics_3'
     }
     discount_ticket_counts = {
         'A': 3,
         'B': 3,
         'C': 3,
         'Split Flipper': 3,
         'Classics Meta': 3
     }
     orm_creation.init_papa_tournaments_divisions(
         self.flask_app,
         True,
         stripe_skus=stripe_skus,
         discount_stripe_skus=discount_stripe_skus,
         discount_ticket_counts=discount_ticket_counts)
     orm_creation.init_papa_tournaments_division_machines(self.flask_app)
     orm_creation.init_papa_players(self.flask_app)
     orm_creation.create_player(
         self.flask_app, {
             'first_name': 'Doug',
             'last_name': 'Polka',
             'ifpa_ranking': '321',
             'linked_division_id': '1'
         })
     orm_creation.create_player(
         self.flask_app, {
             'first_name': 'Al',
             'last_name': 'Thomka',
             'ifpa_ranking': '321',
             'linked_division_id': '1'
         })
     orm_creation.create_player(
         self.flask_app, {
             'first_name': 'Elizabeth',
             'last_name': 'Cromwell',
             'ifpa_ranking': '321',
             'linked_division_id': '1'
         })
     orm_creation.create_player(
         self.flask_app, {
             'first_name': 'Greg',
             'last_name': 'Galanter',
             'ifpa_ranking': '321',
             'linked_division_id': '1'
         })
     orm_creation.create_player(
         self.flask_app, {
             'first_name': 'Josh',
             'last_name': 'Sharpe',
             'ifpa_ranking': '321',
             'linked_division_id': '1'
         })
     orm_creation.create_player(
         self.flask_app, {
             'first_name': 'Mark',
             'last_name': 'Steinman',
             'ifpa_ranking': '321',
             'linked_division_id': '1'
         })
     orm_creation.create_player(
         self.flask_app, {
             'first_name': 'Amy',
             'last_name': 'Covell',
             'ifpa_ranking': '321',
             'linked_division_id': '1'
         })
     orm_creation.create_player(
         self.flask_app, {
             'first_name': 'AJ',
             'last_name': 'Repolgle',
             'ifpa_ranking': '321',
             'linked_division_id': '1'
         })
     orm_creation.create_player(
         self.flask_app, {
             'first_name': 'Fred',
             'last_name': 'Cochran',
             'ifpa_ranking': '321',
             'linked_division_id': '1'
         })
     orm_creation.create_player(
         self.flask_app, {
             'first_name': 'Aiton',
             'last_name': 'Goldman',
             'ifpa_ranking': '321',
             'linked_division_id': '1'
         })
     orm_creation.create_player(
         self.flask_app, {
             'first_name': 'Cassie',
             'last_name': 'Stahl',
             'ifpa_ranking': '321',
             'linked_division_id': '1'
         })
     orm_creation.create_player(
         self.flask_app, {
             'first_name': 'Jon',
             'last_name': 'Replgle',
             'ifpa_ranking': '321',
             'linked_division_id': '1'
         })
    def test_division_final_round_reopen(self):
        self.division.finals_num_qualifiers = 24
        self.flask_app.tables.db_handle.session.commit()
        for i in range(120, 140):
            self.players.append(
                orm_creation.create_player(
                    self.flask_app, {
                        'first_name': 'test',
                        'last_name': 'player%s' % i,
                        'ifpa_ranking': '123',
                        'linked_division_id': '1'
                    }))
        self.populate_scores_for_finals_testing(max_players=30,
                                                with_ties=False)

        with self.flask_app.test_client() as c:
            rv = c.put('/auth/login',
                       data=json.dumps({
                           'username': '******',
                           'password': '******'
                       }))
            rv = c.post('/finals/division_final/division_id/%s' %
                        self.division.division_id)
            self.assertEquals(
                rv.status_code, 200,
                'Was expecting status code 200, but it was %s : %s' %
                (rv.status_code, rv.data))

            division_final_returned = json.loads(rv.data)['data']
            rv = c.put('/auth/login',
                       data=json.dumps({
                           'username': '******',
                           'password': '******'
                       }))
            rv = c.get('/finals/division_final/division_id/%s/qualifiers' %
                       division_final_returned['division_final_id'])
            self.assertEquals(
                rv.status_code, 200,
                'Was expecting status code 200, but it was %s : %s' %
                (rv.status_code, rv.data))
            qualifiers_returned = json.loads(rv.data)['data']
            rv = c.post('/finals/division_final/division_id/%s/rounds' %
                        division_final_returned['division_final_id'],
                        data=json.dumps(qualifiers_returned))
            self.assertEquals(
                rv.status_code, 200,
                'Was expecting status code 200, but it was %s : %s' %
                (rv.status_code, rv.data))
            brackets_returned = json.loads(rv.data)['data']
            round_one_division_final_round_id = brackets_returned[0][
                'division_final_round_id']
            round_two_division_final_round_id = brackets_returned[1][
                'division_final_round_id']
            self.fill_in_final_bracket_scores(
                division_final_returned['division_final_id'], ['1'])

            rv = c.put(
                '/finals/scorekeeping/division_final_round/%s/complete' %
                round_one_division_final_round_id)
            self.assertEquals(
                rv.status_code, 200,
                'Was expecting status code 200, but it was %s : %s' %
                (rv.status_code, rv.data))
            self.fill_in_final_bracket_scores(
                division_final_returned['division_final_id'], ['2'])
            rv = c.put('/finals/scorekeeping/division_final_round/%s/reopen' %
                       round_one_division_final_round_id)
            self.assertEquals(
                rv.status_code, 200,
                'Was expecting status code 200, but it was %s : %s' %
                (rv.status_code, rv.data))
            round_two_division_final_round = self.flask_app.tables.DivisionFinalRound.query.filter_by(
                division_final_round_id=round_two_division_final_round_id
            ).first()
            round_one_division_final_round = self.flask_app.tables.DivisionFinalRound.query.filter_by(
                division_final_round_id=round_one_division_final_round_id
            ).first()

            self.assertEquals(round_one_division_final_round.completed, False)
            for match in round_two_division_final_round.division_final_matches:
                for player_result in match.final_match_player_results:
                    self.assertEquals(player_result.needs_tiebreaker, False)
                    self.assertEquals(player_result.won_tiebreaker, None)
                    self.assertEquals(player_result.final_player_id, None)
                for game in match.final_match_game_results:
                    for score in game.division_final_match_game_player_results:
                        self.assertEquals(score.score, None)
                        self.assertEquals(score.final_player_id, None)
    def test_division_final_generate_brackets(self):
        self.division.finals_num_qualifiers = 24
        self.flask_app.tables.db_handle.session.commit()
        for i in range(120, 140):
            self.players.append(
                orm_creation.create_player(
                    self.flask_app, {
                        'first_name': 'test',
                        'last_name': 'player%s' % i,
                        'ifpa_ranking': '123',
                        'linked_division_id': '1'
                    }))
        self.populate_scores_for_finals_testing(max_players=30,
                                                with_ties=False)

        with self.flask_app.test_client() as c:
            rv = c.put('/auth/login',
                       data=json.dumps({
                           'username': '******',
                           'password': '******'
                       }))
            rv = c.post('/finals/division_final/division_id/%s' %
                        self.division.division_id)
            self.assertEquals(
                rv.status_code, 200,
                'Was expecting status code 200, but it was %s : %s' %
                (rv.status_code, rv.data))

            division_final_returned = json.loads(rv.data)['data']
            rv = c.put('/auth/login',
                       data=json.dumps({
                           'username': '******',
                           'password': '******'
                       }))
            rv = c.get('/finals/division_final/division_id/%s/qualifiers' %
                       division_final_returned['division_final_id'])
            self.assertEquals(
                rv.status_code, 200,
                'Was expecting status code 200, but it was %s : %s' %
                (rv.status_code, rv.data))
            qualifiers_returned = json.loads(rv.data)['data']
            rv = c.post('/finals/division_final/division_id/%s/rounds' %
                        division_final_returned['division_final_id'],
                        data=json.dumps(qualifiers_returned))
            self.assertEquals(
                rv.status_code, 200,
                'Was expecting status code 200, but it was %s : %s' %
                (rv.status_code, rv.data))
            brackets_returned = json.loads(rv.data)['data']

        round = brackets_returned[0]
        self.assertEquals(round['round_number'], "1")
        self.assertEquals(len(round['division_final_matches']), 4)
        match = round['division_final_matches'][0]
        self.assertEquals(len(match['final_match_game_results']), 3)
        self.assertEquals(len(match['final_match_player_results']), 4)
        final_match_game_result = match['final_match_game_results'][0]
        final_match_player_result = match['final_match_player_results'][0]
        self.assertTrue(
            final_match_player_result['final_player_id'] in [9, 16, 17, 24])
        self.assertEquals(
            len(final_match_game_result[
                'division_final_match_game_player_results']), 4)
        final_match_game_player_result = final_match_game_result[
            'division_final_match_game_player_results'][0]
        self.assertTrue(final_match_game_player_result['final_player_id'] in
                        [9, 16, 17, 24])
        self.assertEquals(
            len(self.flask_app.tables.DivisionFinalMatchGameResult.query.all()
                ), 11 * 3)
        self.assertEquals(
            len(self.flask_app.tables.DivisionFinalMatchGamePlayerResult.query.
                all()), 11 * 3 * 4)
        self.assertEquals(
            len(self.flask_app.tables.DivisionFinalMatch.query.all()), 11)
        self.assertEquals(
            len(self.flask_app.tables.DivisionFinalRound.query.all()), 4)
        self.assertEquals(
            len(self.flask_app.tables.DivisionFinalMatchPlayerResult.query.all(
            )), 11 * 4)