def test_update_pastyear(self):
        teams, event_teams, et_keys_to_delete = EventTeamUpdater.update('{}tstupdaterpastyear'.format(CUR_YEAR - 1))
        self.assertEqual(set([team.team_number for team in teams]).symmetric_difference({95, 178, 176, 1922, 173, 2785, 228, 177, 1099, 175, 1027, 3017, 1493, 118, 229, 2791, 155, 549, 195, 4134, 20, 2836, 869, 1665, 4055, 3555, 126, 1699, 1559, 3464, 2168, 3461, 1991, 3467, 2067, 230, 1124, 3104, 236, 237, 1511, 250, 1880, 558, 694, 571, 3634, 3525, 999, 181, 1073, 3146, 1071, 1740, 3719, 3718, 2170, 663, 4122, 3182, 839, 1784, 3654, 743}),
                         set())
        self.assertEqual(set([et.key_name for et in event_teams]).symmetric_difference({'{}tstupdaterpastyear_frc95'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc178'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc176'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc1922'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc173'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc2785'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc228'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc177'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc1099'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc175'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc1027'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc3017'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc1493'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc118'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc229'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc2791'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc155'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc549'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc195'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc4134'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc20'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc2836'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc869'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc1665'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc4055'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc3555'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc126'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc1699'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc1559'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc3464'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc2168'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc3461'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc1991'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc3467'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc2067'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc230'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc1124'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc3104'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc236'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc237'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc1511'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc250'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc1880'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc558'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc694'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc571'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc3634'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc3525'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc999'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc181'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc1073'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc3146'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc1071'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc1740'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc3719'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc3718'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc2170'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc663'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc4122'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc3182'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc839'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc1784'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc3654'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc743'.format(CUR_YEAR - 1)}),
                         set())
        self.assertEqual(et_keys_to_delete, set())

        event_team = EventTeam(
            id="%s_%s" % ('{}tstupdaterpastyear'.format(CUR_YEAR - 1), 'frc9999'),
            event=ndb.Key(Event, '{}tstupdaterpastyear'.format(CUR_YEAR - 1)),
            team=ndb.Key(Team, 'frc9999'),
            year=CUR_YEAR - 1)
        event_team.put()

        teams, event_teams, et_keys_to_delete = EventTeamUpdater.update('{}tstupdaterpastyear'.format(CUR_YEAR - 1))
        self.assertEqual(set([team.team_number for team in teams]).symmetric_difference({95, 178, 176, 1922, 173, 2785, 228, 177, 1099, 175, 1027, 3017, 1493, 118, 229, 2791, 155, 549, 195, 4134, 20, 2836, 869, 1665, 4055, 3555, 126, 1699, 1559, 3464, 2168, 3461, 1991, 3467, 2067, 230, 1124, 3104, 236, 237, 1511, 250, 1880, 558, 694, 571, 3634, 3525, 999, 181, 1073, 3146, 1071, 1740, 3719, 3718, 2170, 663, 4122, 3182, 839, 1784, 3654, 743}),
                         set())
        self.assertEqual(set([et.key_name for et in event_teams]).symmetric_difference({'{}tstupdaterpastyear_frc95'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc178'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc176'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc1922'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc173'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc2785'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc228'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc177'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc1099'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc175'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc1027'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc3017'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc1493'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc118'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc229'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc2791'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc155'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc549'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc195'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc4134'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc20'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc2836'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc869'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc1665'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc4055'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc3555'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc126'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc1699'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc1559'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc3464'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc2168'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc3461'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc1991'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc3467'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc2067'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc230'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc1124'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc3104'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc236'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc237'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc1511'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc250'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc1880'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc558'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc694'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc571'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc3634'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc3525'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc999'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc181'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc1073'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc3146'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc1071'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc1740'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc3719'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc3718'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc2170'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc663'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc4122'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc3182'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc839'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc1784'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc3654'.format(CUR_YEAR - 1), '{}tstupdaterpastyear_frc743'.format(CUR_YEAR - 1)}),
                         set())
        self.assertEqual(et_keys_to_delete, set())
    def test_update_future(self):
        if os.environ.get('TRAVIS', '') != 'true':
            # Flaky on Travis -gregmarra 20130921
            teams, event_teams, et_keys_to_delete = EventTeamUpdater.update('2011tstupdaterfuture')
            self.assertEqual(set([team.team_number for team in teams]).symmetric_difference({95, 178, 176, 1922, 173, 2785, 228, 177, 1099, 175, 1027, 3017, 1493, 118, 229, 2791, 155, 549, 195, 4134, 20, 2836, 869, 1665, 4055, 3555, 126, 1699, 1559, 3464, 2168, 3461, 1991, 3467, 2067, 230, 1124, 3104, 236, 237, 1511, 250, 1880, 558, 694, 571, 3634, 3525, 999, 181, 1073, 3146, 1071, 1740, 3719, 3718, 2170, 663, 4122, 3182, 839, 1784, 3654, 743}),
                             set())
            self.assertEqual(set([et.key_name for et in event_teams]).symmetric_difference({'2011tstupdaterfuture_frc95', '2011tstupdaterfuture_frc178', '2011tstupdaterfuture_frc176', '2011tstupdaterfuture_frc1922', '2011tstupdaterfuture_frc173', '2011tstupdaterfuture_frc2785', '2011tstupdaterfuture_frc228', '2011tstupdaterfuture_frc177', '2011tstupdaterfuture_frc1099', '2011tstupdaterfuture_frc175', '2011tstupdaterfuture_frc1027', '2011tstupdaterfuture_frc3017', '2011tstupdaterfuture_frc1493', '2011tstupdaterfuture_frc118', '2011tstupdaterfuture_frc229', '2011tstupdaterfuture_frc2791', '2011tstupdaterfuture_frc155', '2011tstupdaterfuture_frc549', '2011tstupdaterfuture_frc195', '2011tstupdaterfuture_frc4134', '2011tstupdaterfuture_frc20', '2011tstupdaterfuture_frc2836', '2011tstupdaterfuture_frc869', '2011tstupdaterfuture_frc1665', '2011tstupdaterfuture_frc4055', '2011tstupdaterfuture_frc3555', '2011tstupdaterfuture_frc126', '2011tstupdaterfuture_frc1699', '2011tstupdaterfuture_frc1559', '2011tstupdaterfuture_frc3464', '2011tstupdaterfuture_frc2168', '2011tstupdaterfuture_frc3461', '2011tstupdaterfuture_frc1991', '2011tstupdaterfuture_frc3467', '2011tstupdaterfuture_frc2067', '2011tstupdaterfuture_frc230', '2011tstupdaterfuture_frc1124', '2011tstupdaterfuture_frc3104', '2011tstupdaterfuture_frc236', '2011tstupdaterfuture_frc237', '2011tstupdaterfuture_frc1511', '2011tstupdaterfuture_frc250', '2011tstupdaterfuture_frc1880', '2011tstupdaterfuture_frc558', '2011tstupdaterfuture_frc694', '2011tstupdaterfuture_frc571', '2011tstupdaterfuture_frc3634', '2011tstupdaterfuture_frc3525', '2011tstupdaterfuture_frc999', '2011tstupdaterfuture_frc181', '2011tstupdaterfuture_frc1073', '2011tstupdaterfuture_frc3146', '2011tstupdaterfuture_frc1071', '2011tstupdaterfuture_frc1740', '2011tstupdaterfuture_frc3719', '2011tstupdaterfuture_frc3718', '2011tstupdaterfuture_frc2170', '2011tstupdaterfuture_frc663', '2011tstupdaterfuture_frc4122', '2011tstupdaterfuture_frc3182', '2011tstupdaterfuture_frc839', '2011tstupdaterfuture_frc1784', '2011tstupdaterfuture_frc3654', '2011tstupdaterfuture_frc743'}),
                             set())
            self.assertEqual(et_keys_to_delete, set())

            event_team = EventTeam(
                id="%s_%s" % ('2011tstupdaterfuture', 'frc9999'),
                event=ndb.Key(Event, '2011tstupdaterfuture'),
                team=ndb.Key(Team, 'frc9999'),
                year=2011)
            event_team.put()

            teams, event_teams, et_keys_to_delete = EventTeamUpdater.update('2011tstupdaterfuture')
            self.assertEqual(set([team.team_number for team in teams]).symmetric_difference({95, 178, 176, 1922, 173, 2785, 228, 177, 1099, 175, 1027, 3017, 1493, 118, 229, 2791, 155, 549, 195, 4134, 20, 2836, 869, 1665, 4055, 3555, 126, 1699, 1559, 3464, 2168, 3461, 1991, 3467, 2067, 230, 1124, 3104, 236, 237, 1511, 250, 1880, 558, 694, 571, 3634, 3525, 999, 181, 1073, 3146, 1071, 1740, 3719, 3718, 2170, 663, 4122, 3182, 839, 1784, 3654, 743}),
                             set())
            self.assertEqual(set([et.key_name for et in event_teams]).symmetric_difference({'2011tstupdaterfuture_frc95', '2011tstupdaterfuture_frc178', '2011tstupdaterfuture_frc176', '2011tstupdaterfuture_frc1922', '2011tstupdaterfuture_frc173', '2011tstupdaterfuture_frc2785', '2011tstupdaterfuture_frc228', '2011tstupdaterfuture_frc177', '2011tstupdaterfuture_frc1099', '2011tstupdaterfuture_frc175', '2011tstupdaterfuture_frc1027', '2011tstupdaterfuture_frc3017', '2011tstupdaterfuture_frc1493', '2011tstupdaterfuture_frc118', '2011tstupdaterfuture_frc229', '2011tstupdaterfuture_frc2791', '2011tstupdaterfuture_frc155', '2011tstupdaterfuture_frc549', '2011tstupdaterfuture_frc195', '2011tstupdaterfuture_frc4134', '2011tstupdaterfuture_frc20', '2011tstupdaterfuture_frc2836', '2011tstupdaterfuture_frc869', '2011tstupdaterfuture_frc1665', '2011tstupdaterfuture_frc4055', '2011tstupdaterfuture_frc3555', '2011tstupdaterfuture_frc126', '2011tstupdaterfuture_frc1699', '2011tstupdaterfuture_frc1559', '2011tstupdaterfuture_frc3464', '2011tstupdaterfuture_frc2168', '2011tstupdaterfuture_frc3461', '2011tstupdaterfuture_frc1991', '2011tstupdaterfuture_frc3467', '2011tstupdaterfuture_frc2067', '2011tstupdaterfuture_frc230', '2011tstupdaterfuture_frc1124', '2011tstupdaterfuture_frc3104', '2011tstupdaterfuture_frc236', '2011tstupdaterfuture_frc237', '2011tstupdaterfuture_frc1511', '2011tstupdaterfuture_frc250', '2011tstupdaterfuture_frc1880', '2011tstupdaterfuture_frc558', '2011tstupdaterfuture_frc694', '2011tstupdaterfuture_frc571', '2011tstupdaterfuture_frc3634', '2011tstupdaterfuture_frc3525', '2011tstupdaterfuture_frc999', '2011tstupdaterfuture_frc181', '2011tstupdaterfuture_frc1073', '2011tstupdaterfuture_frc3146', '2011tstupdaterfuture_frc1071', '2011tstupdaterfuture_frc1740', '2011tstupdaterfuture_frc3719', '2011tstupdaterfuture_frc3718', '2011tstupdaterfuture_frc2170', '2011tstupdaterfuture_frc663', '2011tstupdaterfuture_frc4122', '2011tstupdaterfuture_frc3182', '2011tstupdaterfuture_frc839', '2011tstupdaterfuture_frc1784', '2011tstupdaterfuture_frc3654', '2011tstupdaterfuture_frc743'}),
                             set())
            self.assertEqual(set([et_key.id() for et_key in et_keys_to_delete]),
                             set())
    def get(self, event_key):
        teams, event_teams, et_keys_to_del = EventTeamUpdater.update(event_key)

        teams = TeamManipulator.createOrUpdate(teams)

        if teams:
            event_teams = EventTeamManipulator.createOrUpdate(event_teams)

        if et_keys_to_del:
            EventTeamManipulator.delete_keys(et_keys_to_del)

        template_values = {"event_teams": event_teams, "deleted_event_teams_keys": et_keys_to_del}

        path = os.path.join(os.path.dirname(__file__), "../templates/math/eventteam_update_do.html")
        self.response.out.write(template.render(path, template_values))
    def get(self, event_key):
        _, event_teams, et_keys_to_del = EventTeamUpdater.update(event_key)

        if event_teams:
            event_teams = filter(lambda et: et.team.get() is not None, event_teams)
            event_teams = EventTeamManipulator.createOrUpdate(event_teams)

        if et_keys_to_del:
            EventTeamManipulator.delete_keys(et_keys_to_del)

        template_values = {
            'event_teams': event_teams,
            'deleted_event_teams_keys': et_keys_to_del
        }

        path = os.path.join(os.path.dirname(__file__),
                            '../templates/math/eventteam_update_do.html')
        self.response.out.write(template.render(path, template_values))
Example #5
0
    def get(self, event_key):
        _, event_teams, et_keys_to_del = EventTeamUpdater.update(event_key)

        if event_teams:
            event_teams = filter(lambda et: et.team.get() is not None, event_teams)
            event_teams = EventTeamManipulator.createOrUpdate(event_teams)

        if et_keys_to_del:
            EventTeamManipulator.delete_keys(et_keys_to_del)

        template_values = {
            'event_teams': event_teams,
            'deleted_event_teams_keys': et_keys_to_del
        }

        path = os.path.join(os.path.dirname(__file__),
                            '../templates/math/eventteam_update_do.html')
        self.response.out.write(template.render(path, template_values))
    def get(self, event_key):
        teams, event_teams, et_keys_to_del = EventTeamUpdater.update(event_key)

        teams = TeamManipulator.createOrUpdate(teams)

        if teams:
            event_teams = EventTeamManipulator.createOrUpdate(event_teams)

        if et_keys_to_del:
            ndb.delete_multi(et_keys_to_del)

        template_values = {
            'event_teams': event_teams,
            'deleted_event_teams_keys': et_keys_to_del
        }

        path = os.path.join(os.path.dirname(__file__),
                            '../templates/math/eventteam_update_do.html')
        self.response.out.write(template.render(path, template_values))
Example #7
0
    def test_update_future(self):
        teams, event_teams, et_keys_to_delete = EventTeamUpdater.update(
            '{}tstupdaterfuture'.format(CUR_YEAR))
        self.assertEqual(
            set([team.team_number for team in teams]).symmetric_difference({
                95, 178, 176, 1922, 173, 2785, 228, 177, 1099, 175, 1027, 3017,
                1493, 118, 229, 2791, 155, 549, 195, 4134, 20, 2836, 869, 1665,
                4055, 3555, 126, 1699, 1559, 3464, 2168, 3461, 1991, 3467,
                2067, 230, 1124, 3104, 236, 237, 1511, 250, 1880, 558, 694,
                571, 3634, 3525, 999, 181, 1073, 3146, 1071, 1740, 3719, 3718,
                2170, 663, 4122, 3182, 839, 1784, 3654, 743
            }), set())
        self.assertEqual(
            set([et.key_name for et in event_teams]).symmetric_difference({
                '{}tstupdaterfuture_frc95'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc178'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc176'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc1922'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc173'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc2785'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc228'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc177'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc1099'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc175'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc1027'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc3017'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc1493'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc118'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc229'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc2791'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc155'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc549'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc195'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc4134'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc20'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc2836'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc869'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc1665'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc4055'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc3555'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc126'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc1699'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc1559'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc3464'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc2168'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc3461'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc1991'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc3467'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc2067'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc230'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc1124'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc3104'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc236'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc237'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc1511'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc250'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc1880'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc558'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc694'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc571'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc3634'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc3525'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc999'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc181'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc1073'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc3146'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc1071'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc1740'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc3719'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc3718'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc2170'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc663'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc4122'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc3182'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc839'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc1784'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc3654'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc743'.format(CUR_YEAR)
            }), set())
        self.assertEqual(et_keys_to_delete, set())

        event_team = EventTeam(
            id="%s_%s" % ('{}tstupdaterfuture'.format(CUR_YEAR), 'frc9999'),
            event=ndb.Key(Event, '{}tstupdaterfuture'.format(CUR_YEAR)),
            team=ndb.Key(Team, 'frc9999'),
            year=CUR_YEAR)
        event_team.put()

        teams, event_teams, et_keys_to_delete = EventTeamUpdater.update(
            '{}tstupdaterfuture'.format(CUR_YEAR))
        self.assertEqual(
            set([team.team_number for team in teams]).symmetric_difference({
                95, 178, 176, 1922, 173, 2785, 228, 177, 1099, 175, 1027, 3017,
                1493, 118, 229, 2791, 155, 549, 195, 4134, 20, 2836, 869, 1665,
                4055, 3555, 126, 1699, 1559, 3464, 2168, 3461, 1991, 3467,
                2067, 230, 1124, 3104, 236, 237, 1511, 250, 1880, 558, 694,
                571, 3634, 3525, 999, 181, 1073, 3146, 1071, 1740, 3719, 3718,
                2170, 663, 4122, 3182, 839, 1784, 3654, 743
            }), set())
        self.assertEqual(
            set([et.key_name for et in event_teams]).symmetric_difference({
                '{}tstupdaterfuture_frc95'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc178'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc176'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc1922'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc173'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc2785'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc228'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc177'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc1099'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc175'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc1027'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc3017'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc1493'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc118'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc229'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc2791'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc155'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc549'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc195'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc4134'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc20'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc2836'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc869'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc1665'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc4055'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc3555'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc126'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc1699'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc1559'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc3464'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc2168'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc3461'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc1991'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc3467'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc2067'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc230'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc1124'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc3104'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc236'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc237'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc1511'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc250'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc1880'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc558'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc694'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc571'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc3634'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc3525'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc999'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc181'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc1073'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc3146'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc1071'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc1740'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc3719'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc3718'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc2170'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc663'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc4122'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc3182'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc839'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc1784'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc3654'.format(CUR_YEAR),
                '{}tstupdaterfuture_frc743'.format(CUR_YEAR)
            }), set())
        self.assertEqual(set([et_key.id() for et_key in et_keys_to_delete]),
                         set())