Example #1
0
def get_character_skills(character_id, current_user=None):
    character = Character.get(character_id)
    character_application_access_check(current_user, character)
    skill_data = character.get_op(
        'get_characters_character_id_skills',
        character_id=character_id,
    )
    queue_data = character.get_op(
        'get_characters_character_id_skillqueue',
        character_id=character_id,
    )
    for skill_list in skill_data['skills'], queue_data:
        for entry in skill_list:
            skill = Type.get(entry['skill_id'])
            group = Group.get(skill.group_id)
            entry['skill_id'] = {
                'group_name': group.name,
                'skill_name': skill.name,
            }
    return {
        'info': {
            'skills': skill_data['skills'],
            'queue': queue_data,
            'total_sp': skill_data['total_sp']
        }
    }
Example #2
0
def get_character_fittings(character_id, current_user=None):
    character = Character.get(character_id)
    character_application_access_check(current_user, character)
    fitting_data = character.get_op(
        'get_characters_character_id_fittings',
        character_id=character_id,
    )
    types = set()
    for entry in fitting_data:
        types.add(entry['ship_type_id'])
        for item in entry['items']:
            types.add(item['type_id'])
    type_dict = Type.get_multi(list(types))

    for entry in fitting_data:
        entry['redlisted'] = []
        entry['ship_type_name'] = type_dict[entry['ship_type_id']].name
        if type_dict[entry['ship_type_id']].is_redlisted:
            entry['redlisted'].append('ship_type_name')
        items_redlisted = False
        for item in entry['items']:
            item['type_name'] = type_dict[item['type_id']].name
            if type_dict[item['type_id']].is_redlisted:
                item['redlisted'] = ['type_name']
                items_redlisted = True
            else:
                item['redlisted'] = []
        if items_redlisted:
            entry['redlisted'].append('items')
    return {'info': fitting_data}
Example #3
0
def get_character_corporation_history(character_id, current_user=None):
    character = Character.get(character_id)
    character_application_access_check(current_user, character)
    corporation_list = character.get_op(
        'get_characters_character_id_corporationhistory',
        character_id=character_id,
    )
    for entry in corporation_list:
        entry['is_deleted'] = entry.get('is_deleted', False)
        if entry['is_deleted']:
            entry['corporation_name'] = 'Deleted corp {}'.format(
                entry['corporation_id'])
            entry['alliance_name'] = 'Unknown'
            entry['redlisted'] = []
        else:
            corporation = Corporation.get(entry['corporation_id'])
            entry['corporation_name'] = corporation.name
            if corporation.alliance:
                entry['alliance_name'] = corporation.alliance.name
            else:
                entry['alliance_name'] = None
            redlisted_names = []
            if corporation.is_redlisted:
                redlisted_names.append('corporation_name')
            if corporation.alliance and corporation.alliance.is_redlisted:
                redlisted_names.append('alliance_name')
            if character.is_redlisted:
                redlisted_names.append('character_name')
            entry['redlisted'] = redlisted_names
    return {'info': corporation_list}
Example #4
0
def get_corporation_transactions(corporation_id,
                                 highest_id=None,
                                 current_user=None):
    corporation = Corporation.get(corporation_id)
    character = Character.get(corporation.ceo_id)
    character_application_access_check(current_user, character)
    response = character.get_op('get_corporations_corporation_id_divisions',
                                corporation_id=corporation_id)
    wallet_division_data = response['wallet']
    divisions = {
        entry['division']: entry.get('name',
                                     'Division {}'.format(entry['division']))
        for entry in wallet_division_data
    }
    return_data = []
    if highest_id is None:
        kwargs = {}
    else:
        kwargs = {'highest_id': highest_id}
    for division_id, division_name in divisions.items():
        entry = {'division_name': division_name}
        transaction_data = character.get_op(
            'get_corporations_corporation_id_wallets_division_transactions',
            corporation_id=corporation_id,
            division=division_id,
            **kwargs,
        )
        entry.update(process_transactions(character, transaction_data))
        return_data.append(entry)
    return {'info': return_data}
Example #5
0
def get_character_journal(character_id, current_user=None):
    character = Character.get(character_id)
    character_application_access_check(current_user, character)
    wallet_data = character.get_paged_op(
        'get_characters_character_id_wallet_journal',
        character_id=character_id)
    return process_journal(character_id, wallet_data)
Example #6
0
def get_character_mining(character_id, current_user=None):
    character = Character.get(character_id)
    character_application_access_check(current_user, character)
    mining_data = character.get_op(
        'get_characters_character_id_mining',
        character_id=character_id,
    )
    return process_mining(mining_data)
Example #7
0
def get_character_industry(character_id, current_user=None):
    character = Character.get(character_id)
    character_application_access_check(current_user, character)
    industry_job_data = character.get_op(
        'get_characters_character_id_industry_jobs',
        character_id=character_id,
    )
    return process_industry(character, industry_job_data)
Example #8
0
 def test_get_character_1(self):
     c = Character.get("Chewbacca")
     self.assertEqual(c.name, "Chewbacca")
     self.assertEqual(c.planet, "Kashyyyk")
     self.assertEqual(c.species, "Wookiee")
     self.assertEqual(c.gender, "Male")
     self.assertEqual(c.birth, "200 BBY, Kashyyyk")
     self.assertEqual(c.height, "2.28 meters")
Example #9
0
def get_character_market_contracts(character_id, current_user=None):
    character = Character.get(character_id)
    character_application_access_check(current_user, character)
    contract_list = character.get_paged_op(
        'get_characters_character_id_contracts',
        character_id=character_id,
    )
    return process_contracts(character, contract_list)
Example #10
0
def get_character_blueprints(character_id, current_user=None):
    character = Character.get(character_id)
    character_application_access_check(current_user, character)
    assets = get_character_assets(character_id, current_user=current_user)
    blueprints_list = character.get_paged_op(
        'get_characters_character_id_blueprints',
        character_id=character_id,
    )
    return process_blueprints(assets, blueprints_list)
Example #11
0
def get_applicant_notes(applicant_user_id, current_user=None):
    applicant = User.get(applicant_user_id)
    user_application_access_check(current_user, applicant)
    if applicant is None:
        applicant_name = Character.get(applicant_user_id).name
        return {'error': 'User {} is not an applicant'.format(applicant_name)}
    else:
        application = Application.get_for_user(applicant_user_id)
        return {'info': get_application_note_data(application, current_user)}
Example #12
0
def get_character_mail(character_id, last_mail_id=None, current_user=None):
    target_character = Character.get(character_id)
    character_application_access_check(current_user, target_character)
    if last_mail_id:
        kwargs = {'last_mail_id': last_mail_id}
    else:
        kwargs = {}
    mail_list = target_character.get_op('get_characters_character_id_mail',
                                        character_id=character_id,
                                        **kwargs)

    from_ids = set(entry['from'] for entry in mail_list)
    if from_ids:
        character_ids = set()
        corp_ids = set()
        alliance_ids = set()
        mailing_list_ids = set()
        id_set_dict = {
            'character': character_ids,
            'corporation': corp_ids,
            'alliance': alliance_ids,
            'mailing_list': mailing_list_ids,
        }
        name_data = get_from_names(list(from_ids))
        for entry in name_data:
            id_set_dict[entry['category']].add(entry['id'])
        for entry in mail_list:
            for recipient in entry['recipients']:
                id_set_dict[recipient['recipient_type']].add(
                    recipient['recipient_id'])

        characters = Character.get_multi(character_ids)
        corporations = Corporation.get_multi(corp_ids)
        alliances = Alliance.get_multi(alliance_ids)
        all_parties = {}
        all_parties.update(characters)
        all_parties.update(corporations)
        all_parties.update(alliances)
        for id in mailing_list_ids:
            all_parties[id] = MailingList('Mailing List {}'.format(id))

    for entry in mail_list:
        entry['redlisted'] = []
        entry['from_name'] = all_parties[entry['from']].name
        recipients_redlisted = False
        for recipient in entry['recipients']:
            recipient['recipient_name'] = all_parties[
                recipient['recipient_id']].name
            if all_parties[recipient['recipient_id']].is_redlisted:
                recipient['redlisted'] = ['recipient_name']
            else:
                recipient['redlisted'] = []
        if recipients_redlisted:
            entry['redlisted'].append('recipients')
        if all_parties[entry['from']].is_redlisted:
            entry['redlisted'].append('from_name')
    return {'info': mail_list}
Example #13
0
    def test_get_character_3(self):
        c = Character.get("Darth Vader")

        self.assertEqual(c.name, "Darth Vader")
        self.assertEqual(c.planet, "Tatooine")
        self.assertEqual(c.species, "Human")
        self.assertEqual(c.gender, "Male")
        self.assertEqual(c.birth, "41.9 BBY")
        self.assertEqual(c.height, "1.88 meters, later 2.02 in armor")
Example #14
0
def get_mail_body(character_id, mail_id, current_user=None):
    character = Character.get(character_id)
    character_application_access_check(current_user, character)
    mail_data = character.get_op(
        'get_characters_character_id_mail_mail_id',
        character_id=character_id,
        mail_id=mail_id,
    )
    return mail_data['body']
Example #15
0
def get_corporation_assets(corporation_id, current_user=None):
    corporation = Corporation.get(corporation_id)
    character = Character.get(corporation.ceo_id)
    character_application_access_check(current_user, character)
    asset_list = character.get_paged_op(
        'get_corporations_corporation_id_assets',
        corporation_id=corporation_id,
    )
    return process_assets(character, asset_list, corporation_id=corporation_id)
Example #16
0
    def test_get_character_2(self):
        c = Character.get("Boba Fett")

        self.assertEqual(c.name, "Boba Fett")
        self.assertEqual(c.planet, "Kamino")
        self.assertEqual(c.species, "Human")
        self.assertEqual(c.gender, "Male")
        self.assertEqual(c.birth, "31.5 BBY , Kamino")
        self.assertEqual(c.height, "1.83 meters")
Example #17
0
def get_character_bookmarks(character_id, current_user=None):
    character = Character.get(character_id)
    character_application_access_check(current_user, character)
    bookmarks_list = character.get_paged_op(
        'get_characters_character_id_bookmarks',
        character_id=character_id,
    )
    folder_list = character.get_paged_op(
        'get_characters_character_id_bookmarks_folders',
        character_id=character_id)
    return process_bookmarks(character, bookmarks_list, folder_list)
Example #18
0
def get_character_calendar(character_id, current_user=None):
    character = Character.get(character_id)
    character_application_access_check(current_user, character)
    calendar_data = character.get_op('get_characters_character_id_calendar',
                                     character_id=character_id)
    for entry in calendar_data:
        entry.update(
            get_character_calendar_event(character_id,
                                         entry['event_id'],
                                         current_user=current_user))
        entry.pop('date')
    return {'info': calendar_data}
Example #19
0
def get_character_transactions(character_id,
                               highest_id=None,
                               current_user=None):
    character = Character.get(character_id)
    character_application_access_check(current_user, character)
    if highest_id is not None:
        kwargs = {'highest_id': highest_id}
    else:
        kwargs = {}
    wallet_data = character.get_op(
        'get_characters_character_id_wallet_transactions',
        character_id=character_id,
        **kwargs)
    return process_transactions(character, wallet_data)
Example #20
0
def start_application(current_user=None):
    if is_admin(current_user) or is_recruiter(current_user) or is_senior_recruiter(current_user):
        raise BadRequestException('Recruiters cannot apply')
    character = Character.get(current_user.id)
    if character.blocked_from_applying:
        raise ForbiddenException('User is blocked')
    application = Application.get_for_user(current_user.id)
    if application:
        raise BadRequestException('An application is already open')
    # no application, start one
    application = Application(user_id=current_user.id, is_concluded=False)
    db.session.add(application)
    db.session.commit()
    add_status_note(application, 'Application created.')
    return {'status': 'ok'}
Example #21
0
def get_corporation_market_history(corporation_id, current_user=None):
    corporation = Corporation.get(corporation_id)
    character = Character.get(corporation.ceo_id)
    character_application_access_check(current_user, character)
    order_list = list(
        character.get_op(
            'get_corporations_corporation_id_orders',
            corporation_id=corporation_id,
        ))
    order_list.extend(
        character.get_paged_op(
            'get_corporations_corporation_id_orders_history',
            corporation_id=corporation_id,
        ))
    return process_market_history(character, order_list)
Example #22
0
def get_character_clones(character_id, current_user=None):
    character = Character.get(character_id)
    character_application_access_check(current_user, character)
    clone_data = character.get_op('get_characters_character_id_clones',
                                  character_id=character_id)
    location_ids = set([clone_data['home_location']['location_id']])
    location_ids.update(entry['location_id']
                        for entry in clone_data['jump_clones'])
    location_dict = get_location_multi(character, location_ids)
    clone_data['home_location']['redlisted'] = []
    set_system_and_region(clone_data['home_location'], location_dict)
    for entry in clone_data['jump_clones']:
        entry['redlisted'] = []
        set_system_and_region(entry, location_dict)
    return {'info': clone_data}
Example #23
0
def get_character_calendar_event(character_id, event_id, current_user=None):
    character = Character.get(character_id)
    character_application_access_check(current_user, character)
    event_data = character.get_op(
        'get_characters_character_id_calendar_event_id',
        character_id=character_id,
        event_id=event_id,
    )
    event_data['redlisted'] = []
    if event_data['owner_type'] in ('corporation', 'character', 'alliance'):
        owner = get_id_data([event_data['owner_id']],
                            sorted=False)[event_data['owner_id']]
        if owner.is_redlisted:
            event_data['redlisted'].append('owner_name')
    return event_data
Example #24
0
def test_character_creation(database):
    with database.transaction():
        character = Character.create(character_name='Qritz',
                                     player_name='Avery',
                                     alignment='CG',
                                     race='elf',
                                     size='md',
                                     gender='male',
                                     age='29',
                                     height_ft='5',
                                     height_in='4',
                                     weight='109',
                                     hair_color='black',
                                     eye_color='brown')
    from_db = Character.get(Character.character_name == 'Qritz')
    assert from_db == character
    assert Character.select().count() == 1
Example #25
0
def get_character_market_history(character_id, current_user=None):
    character = Character.get(character_id)
    character_application_access_check(current_user, character)
    order_list = list(
        character.get_op(
            'get_characters_character_id_orders',
            character_id=character_id,
        ))
    for entry in order_list:
        entry['is_open'] = True
    historical_orders = character.get_paged_op(
        'get_characters_character_id_orders_history',
        character_id=character_id,
    )
    for entry in historical_orders:
        entry['is_open'] = False
    order_list.extend(historical_orders)
    return process_market_history(character, order_list)
Example #26
0
def send_mail(to_character_id, template_name):
    if not app.config.get('TESTING'):
        to_character = Character.get(to_character_id)
        subject, text = get_mail_text(template_name, name=to_character.name)
        mail_character = get_mail_character()
        mail_character.get_op('post_characters_character_id_mail',
                              character_id=mail_character.id,
                              mail={
                                  'body':
                                  text,
                                  'subject':
                                  subject,
                                  'recipients': [{
                                      'recipient_id': to_character_id,
                                      'recipient_type': 'character',
                                  }]
                              })
    return {'status': 'ok'}
Example #27
0
def get_character_summary(character_id, current_user=None):
    character = Character.get(character_id)
    if (character_id != current_user.id):
        character_application_access_check(current_user, character)
    character_data = character.get_op(
        'get_characters_character_id',
        character_id=character_id,
    )
    application = Application.get_for_user(character.user_id)
    if application is not None:
        character_data['current_application_id'] = application.id
        if character_id == current_user.id:
            character_data[
                'current_application_status'] = own_application_status(
                    current_user)['status']
        else:
            character_data[
                'current_application_status'] = get_application_status(
                    application)
    else:
        character_data['current_application_id'] = None
        character_data['current_application_status'] = None
    character_data['security_status'] = character_data.get(
        'security_status', 0.)
    corporation = Corporation.get(character_data['corporation_id'])
    if character.corporation_id != corporation.id:
        character.corporation_id = corporation.id
        db.session.commit()
    character_data['corporation_name'] = corporation.name
    if corporation.alliance is not None:
        character_data['alliance_name'] = corporation.alliance.name
    else:
        character_data['alliance_name'] = None
    character_data['character_name'] = character_data.pop('name')
    character_data['character_id'] = character_id
    redlisted_names = []
    if corporation.is_redlisted:
        redlisted_names.append('corporation_name')
    if corporation.alliance and corporation.alliance.is_redlisted:
        redlisted_names.append('alliance_name')
    if character.is_redlisted:
        redlisted_names.append('character_name')
    character_data['redlisted'] = redlisted_names
    return {'info': character_data}
Example #28
0
def get_application_note_data(application, current_user):
    result = []
    authors = {}
    for note in application.notes:
        if note.author_id in authors:
            author = authors[note.author_id]
        else:
            author = Character.get(note.author_id)
            authors[note.author_id] = author
        result.append({
            'id': note.id,
            'text': note.text,
            'title': note.title,
            'author': author.name,
            'can_edit': author.id == current_user.id,
            'is_chat_log': note.is_chat_log,
            'timestamp': note.timestamp,
        })
    return result
Example #29
0
def get_transaction_party(party_id):
    try:
        character = Character.get(party_id)
        corporation = Corporation.get(character.corporation_id)
        return_dict = {
            'id': party_id,
            'name': character.name,
            'party_type': 'character',
            'corporation_name': corporation.name,
            'corporation_ticker': corporation.ticker,
        }
        return Character.is_redlisted, return_dict
    except IOError:  # change to the correct exception when you know it
        corporation = Corporation.get(party_id)
        return_dict = {
            'id': party_id,
            'name': corporation.name,
            'party_type': 'corporation',
            'corporation_name': corporation.name,
            'corporation_ticker': corporation.ticker,
        }
        return Corporation.is_redlisted, return_dict
Example #30
0
    def test_get_character_serialize_2(self):
        expected = {
            "birth": "200 BBY, Kashyyyk",
            "description": "Chewbacca (or \"Chewie\", as he was known by his friends) was a legendary Wookiee from Kashyyyk and co-pilot of Han Solo's ship, the Millennium Falcon. He was the son of Attichitcuk, the husband of Mallatobuck, and the father of Lumpawaroo. Chewbacca carried with him the name of an ancient Wookiee hero, the great Bacca, first of the great chieftains of Kashyyyk, and the creator of a sword that denoted leadership among the Wookiees. This name placed Chewbacca in a noble lineage.",
            "gender": "Male",
            "height": "2.28 meters",
            "image": "http://img4.wikia.nocookie.net/__cb20080815045819/starwars/images/thumb/7/73/Chewbaccaheadshot.jpg/500px-Chewbaccaheadshot.jpg",
            "name": "Chewbacca",
            "planet": "Kashyyyk",
            "species": "Wookiee"
        }

        actual = Character.get("Chewbacca").serialize
        bool_result = actual["birth"] == expected["birth"] and \
                        actual["description"] == expected["description"] and \
                        actual["name"] == expected["name"] and \
                        actual["image"] == expected["image"] and \
                        actual["gender"] == expected["gender"] and \
                        actual["height"] == expected["height"] and \
                        actual["planet"] == expected["planet"] and \
                        actual["species"] == expected["species"]

        self.assertEqual(True, bool_result)    
Example #31
0
    def test_get_character_serialize_1(self):
        expected = {
            "birth": "31.5 BBY , Kamino",
            "description": "Boba Fett was a Mandalorian warrior and bounty hunter. He was the only unaltered clone of the famed Jango Fett, created in 32 BBY as unit A0050, one of the first of many Fett replicas designed to become part of the Grand Army of the Republic, and was raised as Jango's son. Jango taught Boba much, training him to become a skilled bounty hunter as was his father-figure before him. In 22 BBY, Jango was killed at the Battle of Geonosis, which opened the Clone Wars.",
            "gender": "Male",
            "height": "1.83 meters",
            "image": "http://img2.wikia.nocookie.net/__cb20130920001614/starwars/images/5/58/BobaFettMain2.jpg",
            "name": "Boba Fett",
            "planet": "Kamino",
            "species": "Human"
        }

        actual = Character.get("Boba Fett").serialize
        bool_result = actual["birth"] == expected["birth"] and \
                        actual["description"] == expected["description"] and \
                        actual["name"] == expected["name"] and \
                        actual["image"] == expected["image"] and \
                        actual["gender"] == expected["gender"] and \
                        actual["height"] == expected["height"] and \
                        actual["planet"] == expected["planet"] and \
                        actual["species"] == expected["species"]

        self.assertEqual(True, bool_result)        
Example #32
0
def get_corporation_journal(corporation_id, current_user=None):
    corporation = Corporation.get(corporation_id)
    character = Character.get(corporation.ceo_id)
    character_application_access_check(current_user, character)
    response = character.get_op('get_corporations_corporation_id_divisions',
                                corporation_id=corporation_id)
    wallet_division_data = response['wallet']
    divisions = {
        entry['division']: entry.get('name',
                                     'Division {}'.format(entry['division']))
        for entry in wallet_division_data
    }
    return_data = []
    for division_id, division_name in divisions.items():
        entry = {'division_name': division_name}
        journal_data = character.get_paged_op(
            'get_corporations_corporation_id_wallets_division_journal',
            corporation_id=corporation_id,
            division=division_id,
        )
        entry['info'] = process_journal(character.id, journal_data)['info']
        return_data.append(entry)
    return {'info': return_data}
Example #33
0
def get_character_planetary_interaction(character_id, current_user=None):
    character = Character.get(character_id)
    character_application_access_check(current_user, character)
    planet_data = character.get_op(
        'get_characters_character_id_planets',
        character_id=character_id,
    )
    system_ids = set()
    for entry in planet_data:
        system_ids.add(entry['solar_system_id'])
    system_dict = System.get_multi(list(system_ids))

    for entry in planet_data:
        entry['redlisted'] = []
        system = system_dict[entry.pop('solar_system_id')]
        entry['system_id'] = system.id
        entry['system_name'] = system.name
        entry['region_id'] = system.region_id
        entry['region_name'] = system.region.name
        if system.is_redlisted:
            entry['redlisted'].append('system_name')
        if system.region.is_redlisted:
            entry['redlisted'].append('region_name')
    return {'info': planet_data}
Example #34
0
 def test_character_repr_2(self):
     actual = str(Character.get("Chewbacca"))
     self.assertEqual(actual, "<name Chewbacca>")
Example #35
0
 def test_character_repr_1(self):
     actual = str(Character.get("Boba Fett"))
     self.assertEqual(actual, "<name Boba Fett>")
Example #36
0
    def initDB(self):
        self.clearDB()
        admin_character = Character(
            id=1000,
            user_id=1000,
            name='Admin Alice',
            corporation_id=self.ascee_corp_id,
        )
        db.session.add(admin_character)
        self.admin = User.get(1000)
        admin = Admin(
            id=1000,
        )
        db.session.add(admin)

        senior_recruiter_character = Character(
            id=1001,
            user_id=1001,
            name='Senior Sam',
            corporation_id=self.ascee_corp_id,
        )
        db.session.add(senior_recruiter_character)
        self.senior_recruiter = User.get(1001)
        senior_recruiter = Recruiter(
            id=1001,
            is_senior=True,
        )
        db.session.add(senior_recruiter)

        recruiter_character = Character(
            id=1002,
            user_id=1002,
            name='Recruiter Randy',
            corporation_id=self.ascee_corp_id,
        )
        db.session.add(recruiter_character)
        self.recruiter = User.get(1002)
        recruiter = Recruiter(
            id=1002,
        )
        db.session.add(recruiter)

        other_recruiter_character = Character(
            id=1003,
            user_id=1003,
            name='OtherRecruiter Oswald',
            corporation_id=self.ascee_corp_id,
        )
        db.session.add(other_recruiter_character)
        self.other_recruiter = User.get(1003)
        db.session.add(self.other_recruiter)
        other_recruiter = Recruiter(
            id=1003,
        )
        db.session.add(other_recruiter)
        db.session.commit()

        test_applicant_id = 2114496483
        self.applicant_character = Character.get(
            test_applicant_id,
        )
        self.applicant_character.user_id = test_applicant_id
        self.applicant_character.refresh_token = 'GCe-dZ58iNCRfX2sXf9DcGiP0T-ig8kyIHjr6vK9zHwfL3ij8R0emIuuy2m-gqHPGB_rn5CVUBTv8uhgmN9Tkvmnjp3uOPihHmOlfAqwooN-xbJTmR8w7wWOAhcvCRK62wm6mYMRaz2tI0--a65jeV4OKNxRYFUDiMvM-YMvF6D8AHTr8N9Gl5uCSsgXAz66ewrX7hega5DRGYlOlyFZZmpZRCX8l095aDBDk_GXwljRD4o4FoRfesc6DGsyQ3MUuxlbkwuJbeiyJxWjBkaCgLQEiJkLJf35NMclkU14EEy8nDwf4zjg1ZqXlUAxcjV7DosWh9nZU33_cmKTmKkD8apD3Ozsq5QSjji0TWzZA3Y'
        self.applicant_character.user_id = test_applicant_id
        db.session.add(self.applicant_character)

        self.applicant = User.get(id=test_applicant_id)
        db.session.add(self.applicant)
        db.session.commit()

        test_not_applicant_id = 2112166943
        self.not_applicant_character = Character.get(
            test_not_applicant_id,
        )
        db.session.add(self.not_applicant_character)

        self.not_applicant = User.get(id=test_not_applicant_id)
        db.session.add(self.not_applicant)
        db.session.commit()

        self.application = Application(
            user_id=self.applicant.id,
            recruiter_id=self.recruiter.id,
            is_submitted=True,
        )
        db.session.add(self.application)
        db.session.commit()

        self.redlisted_character_1 = Character(
            id=1234,
            user_id=1234,
            name='Redlisted Robert',
            corporation_id=self.ascee_corp_id,
            redlisted=True,
        )
        self.redlisted_character_2 = Character(
            id=4321,
            user_id=4321,
            name='Redlisted Rebecca',
            corporation_id=self.ascee_corp_id,
            redlisted=True,
        )
        db.session.add(self.redlisted_character_1)
        db.session.add(self.redlisted_character_2)
        db.session.commit()