示例#1
0
def benefits_data_types(idWho):
	""" Receives the benefit's id (idWho) and checks if the user is allowed to edit that
	benefits types of data. If 'GET' method, a list of all data types available and a list of the
	Benefit's pre selected types of data is returned. If 'POST' method, the information received 
	is checked and then updated to the database."""
	idWho = validate_benefit_idwho(idWho, session['idCompany'])
	if idWho:
		if request.method == "POST":
			ids_datatype = request.form.getlist("idDatatype")
			ids_datatype_check = data_types_exist(ids_datatype)
			if ids_datatype_check is not None:
				update_benefit_data_types(idWho, ids_datatype_check)
				return redirect("/beneficios/perfil/{}".format(idWho))
			else: 
				whoops = "Houve um erro na atualização dos tipos de dado. Selecione outro do menu."
				profile = BenefitProfile(idWho).get_profile()
				available_datatypes = get_available_data_types_for_benefit(idWho)
				return render_template("benefits_edit_data_types.html", 
										header = get_header(session), profile = profile, 
										available_datatypes = available_datatypes)
		else: # 'GET'
			profile = BenefitProfile(idWho).get_profile()
			available_datatypes = get_available_data_types_for_benefit(idWho)
			return render_template("benefits_edit_data_types.html", 
									header = get_header(session), profile = profile, 
									available_datatypes = available_datatypes)
	else:
		whoops = "Este perfil não existe, por favor selecione um benefício da lista."
		benefits_list = CompanyProfile(session["idCompany"]).get_benefits()
		return render_template("benefits_list.html", header = get_header(session), 
								benefits_list = benefits_list, whoops = whoops)
class TestGetName(unittest.TestCase):
    def setUp(self):
        call("./setup/start_testing.sh")

        self.profile_one = BenefitProfile(1)
        self.profile_two = BenefitProfile(2)
        self.profile_three = BenefitProfile(3)

    def tearDown(self):
        call("./setup/finish_testing.sh")

    def test_get_benefit_name_one(self):
        actual_result = self.profile_one.get_name()
        expected_result = "Plano de Saúde Norte Europa"
        self.assertEqual(actual_result, expected_result)

    def test_get_benefit_name_two(self):
        actual_result = self.profile_two.get_name()
        expected_result = "Plano de Saúde Pampulha Intermédica"
        self.assertEqual(actual_result, expected_result)

    def test_get_benefit_name_three(self):
        actual_result = self.profile_three.get_name()
        expected_result = "Plano Dental Sorriso"
        self.assertEqual(actual_result, expected_result)

    def test_get_benefit_name_benefit_doesnt_exist(self):
        with self.assertRaises(Exception):
            BenefitProfile(9999).get_name()

    def test_get_benefit_name_string_input(self):
        with self.assertRaises(TypeError):
            BenefitProfile("1").get_name()

    def test_get_benefit_name_float_input(self):
        with self.assertRaises(TypeError):
            BenefitProfile(99.2).get_name()

    def test_get_benefit_name_datatype_input(self):
        with self.assertRaises(TypeError):
            BenefitProfile(str).get_name()

    def test_get_benefit_name_none_input(self):
        with self.assertRaises(TypeError):
            BenefitProfile(None).get_name()

    def test_get_benefit_name_empty_input(self):
        with self.assertRaises(TypeError):
            BenefitProfile().get_name()

    def test_get_benefit_name_boolean_input(self):
        with self.assertRaises(TypeError):
            BenefitProfile(True).get_name()
示例#3
0
def update_benefit_data_types(idBenefit, ids_datatypes):
    """ Receives a benefit's id and a list of ids of types of data (datatypes). 
	This function is called when benefits want to change the type of data they require
	for enrollment, this should be reflected in the database. This function first checks
	if any changes are necessary. Returns <void>"""
    if not benefit_exists(idBenefit):
        raise Exception("Benefit doesn't exist")
    current_data_types = BenefitProfile(idBenefit).get_data_types()
    submitted_data_types = []
    if len(ids_datatypes) > 0:
        for id_datatype in ids_datatypes:
            datatype = query_datatype_details(id_datatype)
            submitted_data_types.append({
                "idDatatype": id_datatype,
                "name": datatype[0]['name'],
                "example": datatype[0]['example']
            })
    # Check if benefit had datatypes and got them all taken away
    if len(submitted_data_types) == 0 and len(current_data_types) > 0:
        for data_type in current_data_types:
            remove_data_type_from_benefit(data_type['idDatatype'], idBenefit)
    else:
        for data_type in submitted_data_types:
            if data_type in current_data_types:
                pass
            elif data_type not in current_data_types:
                add_new_data_type_to_benefit(data_type['idDatatype'],
                                             idBenefit)
        for data_type in current_data_types:
            if data_type not in submitted_data_types:
                remove_data_type_from_benefit(data_type['idDatatype'],
                                              idBenefit)
示例#4
0
def benefits_registration_card(idBenefit, idPerson):
	""" Receives idBenefit and idPerson and checks if the user can see that benefit's 
	registration card (benefit must be registered with the user's company as well as the person must
	be a company employee). If the information checks out, the employee's (person) benefit 
	registration card is returned with all correlated data """
	if validate_registration_card(idBenefit, idPerson, session['idCompany']):
		idBenefit = int(idBenefit)
		idPerson = int(idPerson)
		benefit_profile = BenefitProfile(idBenefit).get_profile()
		person_profile = PersonProfile(idPerson).get_profile()
		person_data = get_combined_data_for_person([idBenefit,], idPerson)
		admission_date = get_person_admission_date(idPerson, idBenefit)
		return render_template("benefits_registration_card.html", header = get_header(session),
												benefit = benefit_profile,
												person = person_profile,
												person_data = person_data,
												admission_date = admission_date)
	else:
		whoops = "Este Cartão de Registro não existe."
		return render_template("index.html", header = get_header(session),
												whoops = whoops)
	return render_template("benefits_registration_card.html", header = get_header(session),
												benefit = benefit_profile,
												person = person_profile,
												admission_date = admission_date)
示例#5
0
def benefits_profile(idWho):
	""" Receives the benefit's id (idWho) and checks if the user is allowed to see
	that benefit's profile. This is an upgrade from the last version in which anyone could 
	see any benefit, even if the user's company wasn't registered with that benefit. If that
	is the case an alert is shown to the user. Otherwise the benefit profile is returned."""
	idWho = validate_benefit_idwho(idWho, session['idCompany'])
	if idWho:
		profile = BenefitProfile(idWho).get_profile()
		benefit_people = BenefitProfile(idWho).get_people_by_company(session['idCompany'])
		return render_template("benefits_profile.html", header = get_header(session),
								profile = profile, benefit_people = benefit_people)
	else:
		whoops = "Este perfil não existe, por favor selecione um benefício da lista."
		benefits_list = CompanyProfile(session["idCompany"]).get_benefits()
		return render_template("benefits_list.html", header = get_header(session), 
								benefits_list = benefits_list, whoops = whoops)
示例#6
0
def get_combined_data_for_person(chosen_benefits, new_person_id):
    """ This is a tricky one. Receives a list of benefit ids and a person's
	id and returns a list of dictionaries with the combined information
	(data types) between benefits and person. Reserved data types such as
	name, cpf and data admissão are treated differently according """
    all_benefits_data = []
    for benefit_id in chosen_benefits:
        benefit_data = BenefitProfile(benefit_id).get_data_types()
        for data_type in benefit_data:
            if data_type not in all_benefits_data:
                all_benefits_data.append(data_type)
    person_profile = PersonProfile(new_person_id).get_profile()
    combined_data = []
    for data_type in all_benefits_data:
        if data_type['name'] == 'Nome':
            combined_data.append({
                'idDatatype': data_type['idDatatype'],
                'name': data_type['name'],
                'data': person_profile['name'],
                'example': data_type['example']
            })
        elif data_type['name'] == 'CPF':
            combined_data.append({
                'idDatatype': data_type['idDatatype'],
                'name': data_type['name'],
                'data': person_profile['cpf'],
                'example': data_type['example']
            })
        elif data_type['name'] == 'Data Admissão':
            combined_data.append({
                'idDatatype': data_type['idDatatype'],
                'name': data_type['name'],
                'data': data_type['example'],
                'example': data_type['example']
            })
        else:
            combined_data.append({
                'idDatatype':
                data_type['idDatatype'],
                'name':
                data_type['name'],
                'data':
                get_person_one_data(new_person_id, data_type['idDatatype']),
                'example':
                data_type['example']
            })
    return (combined_data)
示例#7
0
def update_person_benefits(idPerson, ids_benefit):
    """ Receives a person's id and a list of ids of benefits. 
	This function is called when a person is enrolling in new benefits or 
	unenrolling in current ones. This function first checks if any changes are 
	necessary. Returns true if a new benefit was added so we can later get the
	new data necessary for enrollment. Returns false in case there's no new
	benefit enrollment, and True if there is."""
    if not person_exists(idPerson):
        raise Exception("Person doesn't exist")
    flag = 0
    current_benefits = PersonProfile(idPerson).get_benefits()
    submitted_benefits = []
    if len(ids_benefit) > 0:
        for id_benefit in ids_benefit:
            submitted_benefits.append({
                "idBenefit":
                id_benefit,
                "name":
                BenefitProfile(id_benefit).get_name()
            })
    # Check if person had benefits and got them all taken away
    if len(submitted_benefits) == 0 and len(current_benefits) > 0:
        for benefit in current_benefits:
            remove_person_from_benefit(idPerson, benefit['idBenefit'])
    else:
        for benefit in submitted_benefits:
            if benefit in current_benefits:
                pass
            elif benefit not in current_benefits:
                register_person_to_benefit(idPerson, benefit['idBenefit'])
                flag = 1
        for current_benefit in current_benefits:
            if current_benefit not in submitted_benefits:
                remove_person_from_benefit(idPerson,
                                           current_benefit['idBenefit'])
    if flag == 1:
        return True
    else:
        return False
 def test_get_benefit_companies_none_input(self):
     with self.assertRaises(TypeError):
         BenefitProfile(None).get_companies()
class TestGetProfile(unittest.TestCase):
    def setUp(self):
        call("./setup/start_testing.sh")

        self.profile_one = BenefitProfile(1)
        self.profile_two = BenefitProfile(2)
        self.profile_three = BenefitProfile(3)

        self.profile_one_data = {
            "id":
            1,
            "name":
            "Plano de Saúde Norte Europa",
            "companies": [{
                "idCompany": 3,
                "name": "Acme Co"
            }, {
                "idCompany": 1,
                "name": "Wonka Industries"
            }],
            "data_types": [{
                "idDatatype": 1,
                "name": "Nome",
                "example": "Ex. Ronaldo Farias Azevedo"
            }, {
                "idDatatype":
                2,
                "name":
                "CPF",
                "example":
                "Digite o número do CPF no padrão. Ex. 000.000.000-00"
            }, {
                "idDatatype": 3,
                "name": "Data Admissão",
                "example": "Este dado é gerado automaticamente"
            }, {
                "idDatatype": 8,
                "name": "Email",
                "example": "Ex. [email protected]"
            }]
        }
        self.profile_two_data = {
            "id":
            2,
            "name":
            "Plano de Saúde Pampulha Intermédica",
            "companies": [{
                "idCompany": 2,
                "name": "Tio Patinhas Bank"
            }, {
                "idCompany": 1,
                "name": "Wonka Industries"
            }],
            "data_types": [{
                "idDatatype": 1,
                "name": "Nome",
                "example": "Ex. Ronaldo Farias Azevedo"
            }, {
                "idDatatype":
                2,
                "name":
                "CPF",
                "example":
                "Digite o número do CPF no padrão. Ex. 000.000.000-00"
            }, {
                "idDatatype": 3,
                "name": "Data Admissão",
                "example": "Este dado é gerado automaticamente"
            }, {
                "idDatatype":
                4,
                "name":
                "Endereço",
                "example":
                "Ex. Av. Rebouças, 1020, ap 23, São Paulo - SP"
            }]
        }
        self.profile_three_data = {
            "id":
            3,
            "name":
            "Plano Dental Sorriso",
            "companies": [{
                "idCompany": 3,
                "name": "Acme Co"
            }, {
                "idCompany": 2,
                "name": "Tio Patinhas Bank"
            }, {
                "idCompany": 1,
                "name": "Wonka Industries"
            }],
            "data_types": [{
                "idDatatype": 1,
                "name": "Nome",
                "example": "Ex. Ronaldo Farias Azevedo"
            }, {
                "idDatatype":
                2,
                "name":
                "CPF",
                "example":
                "Digite o número do CPF no padrão. Ex. 000.000.000-00"
            }, {
                "idDatatype": 5,
                "name": "Peso (kg)",
                "example": "Digite somente os números. Ex. 75"
            }, {
                "idDatatype":
                6,
                "name":
                "Altura (cm)",
                "example":
                "Digite somente os números em centímetros. Ex. 175"
            }]
        }

    def tearDown(self):
        call("./setup/finish_testing.sh")

    def test_get_profile_one(self):
        for key in self.profile_one_data.keys():
            actual_result = self.profile_one.get_profile().get(key)
            expected_result = self.profile_one_data.get(key)
            self.assertEqual(actual_result, expected_result)

    def test_get_profile_two(self):
        for key in self.profile_two_data.keys():
            actual_result = self.profile_two.get_profile().get(key)
            expected_result = self.profile_two_data.get(key)
            self.assertEqual(actual_result, expected_result)

    def test_get_profile_three(self):
        for key in self.profile_three_data.keys():
            actual_result = self.profile_three.get_profile().get(key)
            expected_result = self.profile_three_data.get(key)
            self.assertEqual(actual_result, expected_result)
 def test_get_benefit_data_types_empy_input(self):
     with self.assertRaises(TypeError):
         BenefitProfile().get_data_types()
    def setUp(self):
        call("./setup/start_testing.sh")

        self.profile_one = BenefitProfile(1)
        self.profile_two = BenefitProfile(2)
        self.profile_three = BenefitProfile(3)
 def test_get_benefit_people_by_company_boolean_input(self):
     with self.assertRaises(TypeError):
         BenefitProfile(True).get_people_by_company()
 def test_get_benefit_people_by_company_string_input(self):
     with self.assertRaises(TypeError):
         BenefitProfile("1").get_people_by_company()
 def test_get_benefit_name_benefit_doesnt_exist(self):
     with self.assertRaises(Exception):
         BenefitProfile(9999).get_name()
class TestGetPeopleByCompany(unittest.TestCase):
    def setUp(self):
        call("./setup/start_testing.sh")

        self.profile_one = BenefitProfile(1)
        self.profile_two = BenefitProfile(2)
        self.profile_three = BenefitProfile(3)

    def tearDown(self):
        call("./setup/finish_testing.sh")

    def test_get_benefit_people_by_company_one(self):
        actual_result = self.profile_one.get_people_by_company(1)
        expected_result = [{
            'idPerson': 1,
            'idCompany': 1,
            'name': 'Pessoa da Wonka'
        }]
        self.assertEqual(actual_result, expected_result)

    def test_get_benefit_people_by_company_two(self):
        actual_result = self.profile_two.get_people_by_company(2)
        expected_result = []
        self.assertEqual(actual_result, expected_result)

    def test_get_benefit_people_by_company_three(self):
        actual_result = self.profile_three.get_people_by_company(1)
        expected_result = [{
            'idPerson': 1,
            'idCompany': 1,
            'name': 'Pessoa da Wonka'
        }]
        self.assertEqual(actual_result, expected_result)

    def test_get_benefit_people_by_company_company_doesnt_exist(self):
        with self.assertRaises(Exception):
            BenefitProfile(9999).get_people_by_company()

    def test_get_benefit_people_by_company_string_input(self):
        with self.assertRaises(TypeError):
            BenefitProfile("1").get_people_by_company()

    def test_get_benefit_people_by_company_float_input(self):
        with self.assertRaises(TypeError):
            BenefitProfile(1.3).get_people_by_company()

    def test_get_benefit_people_by_company_datatype_input(self):
        with self.assertRaises(TypeError):
            BenefitProfile(str).get_people_by_company()

    def test_get_benefit_people_by_company_none_input(self):
        with self.assertRaises(TypeError):
            BenefitProfile(None).get_people_by_company()

    def test_get_benefit_people_by_company_empy_input(self):
        with self.assertRaises(TypeError):
            BenefitProfile().get_people_by_company()

    def test_get_benefit_people_by_company_boolean_input(self):
        with self.assertRaises(TypeError):
            BenefitProfile(True).get_people_by_company()
 def test_get_benefit_people_by_company_company_doesnt_exist(self):
     with self.assertRaises(Exception):
         BenefitProfile(9999).get_people_by_company()
 def test_get_benefit_name_float_input(self):
     with self.assertRaises(TypeError):
         BenefitProfile(99.2).get_name()
 def test_get_benefit_people_by_company_none_input(self):
     with self.assertRaises(TypeError):
         BenefitProfile(None).get_people_by_company()
 def test_get_benefit_name_empty_input(self):
     with self.assertRaises(TypeError):
         BenefitProfile().get_name()
class TestGetDataTypes(unittest.TestCase):
    def setUp(self):
        call("./setup/start_testing.sh")

        self.profile_one = BenefitProfile(1)
        self.profile_two = BenefitProfile(2)
        self.profile_three = BenefitProfile(3)

    def tearDown(self):
        call("./setup/finish_testing.sh")

    def test_get_benefit_data_types_one(self):
        actual_result = self.profile_one.get_data_types()
        expected_result = [{
            "idDatatype": 1,
            "name": "Nome",
            "example": "Ex. Ronaldo Farias Azevedo"
        }, {
            "idDatatype":
            2,
            "name":
            "CPF",
            "example":
            "Digite o número do CPF no padrão. Ex. 000.000.000-00"
        }, {
            "idDatatype": 3,
            "name": "Data Admissão",
            "example": "Este dado é gerado automaticamente"
        }, {
            "idDatatype": 8,
            "name": "Email",
            "example": "Ex. [email protected]"
        }]
        self.assertEqual(actual_result, expected_result)

    def test_get_benefit_data_types_two(self):
        actual_result = self.profile_two.get_data_types()
        expected_result = [{
            "idDatatype": 1,
            "name": "Nome",
            "example": "Ex. Ronaldo Farias Azevedo"
        }, {
            "idDatatype":
            2,
            "name":
            "CPF",
            "example":
            "Digite o número do CPF no padrão. Ex. 000.000.000-00"
        }, {
            "idDatatype": 3,
            "name": "Data Admissão",
            "example": "Este dado é gerado automaticamente"
        }, {
            "idDatatype":
            4,
            "name":
            "Endereço",
            "example":
            "Ex. Av. Rebouças, 1020, ap 23, São Paulo - SP"
        }]
        self.assertEqual(actual_result, expected_result)

    def test_get_benefit_data_types_three(self):
        actual_result = self.profile_three.get_data_types()
        expected_result = [{
            "idDatatype": 1,
            "name": "Nome",
            "example": "Ex. Ronaldo Farias Azevedo"
        }, {
            "idDatatype":
            2,
            "name":
            "CPF",
            "example":
            "Digite o número do CPF no padrão. Ex. 000.000.000-00"
        }, {
            "idDatatype": 5,
            "name": "Peso (kg)",
            "example": "Digite somente os números. Ex. 75"
        }, {
            "idDatatype":
            6,
            "name":
            "Altura (cm)",
            "example":
            "Digite somente os números em centímetros. Ex. 175"
        }]
        self.assertEqual(actual_result, expected_result)

    def test_get_benefit_data_types_company_doesnt_exist(self):
        with self.assertRaises(Exception):
            BenefitProfile(9999).get_data_types()

    def test_get_benefit_data_types_string_input(self):
        with self.assertRaises(TypeError):
            BenefitProfile("1").get_data_types()

    def test_get_benefit_data_types_float_input(self):
        with self.assertRaises(TypeError):
            BenefitProfile(1.3).get_data_types()

    def test_get_benefit_data_types_datatype_input(self):
        with self.assertRaises(TypeError):
            BenefitProfile(str).get_data_types()

    def test_get_benefit_data_types_none_input(self):
        with self.assertRaises(TypeError):
            BenefitProfile(None).get_data_types()

    def test_get_benefit_data_types_empy_input(self):
        with self.assertRaises(TypeError):
            BenefitProfile().get_data_types()

    def test_get_benefit_data_types_boolean_input(self):
        with self.assertRaises(TypeError):
            BenefitProfile(True).get_data_types()
class TestGetCompanies(unittest.TestCase):
    def setUp(self):
        call("./setup/start_testing.sh")

        self.profile_one = BenefitProfile(1)
        self.profile_two = BenefitProfile(2)
        self.profile_three = BenefitProfile(3)

    def tearDown(self):
        call("./setup/finish_testing.sh")

    def test_get_benefit_companies_one(self):
        actual_result = self.profile_one.get_companies()
        expected_result = [{
            "idCompany": 3,
            "name": "Acme Co"
        }, {
            "idCompany": 1,
            "name": "Wonka Industries"
        }]
        self.assertEqual(actual_result, expected_result)

    def test_get_benefit_companies_two(self):
        actual_result = self.profile_two.get_companies()
        expected_result = [{
            "idCompany": 2,
            "name": "Tio Patinhas Bank"
        }, {
            "idCompany": 1,
            "name": "Wonka Industries"
        }]
        self.assertEqual(actual_result, expected_result)

    def test_get_benefit_companies_three(self):
        actual_result = self.profile_three.get_companies()
        expected_result = [{
            "idCompany": 3,
            "name": "Acme Co"
        }, {
            "idCompany": 2,
            "name": "Tio Patinhas Bank"
        }, {
            "idCompany": 1,
            "name": "Wonka Industries"
        }]
        self.assertEqual(actual_result, expected_result)

    def test_get_benefit_companies_company_doesnt_exist(self):
        with self.assertRaises(Exception):
            BenefitProfile(9999).get_companies()

    def test_get_benefit_companies_string_input(self):
        with self.assertRaises(TypeError):
            BenefitProfile("1").get_companies()

    def test_get_benefit_companies_float_input(self):
        with self.assertRaises(TypeError):
            BenefitProfile(1.3).get_companies()

    def test_get_benefit_companies_datatype_input(self):
        with self.assertRaises(TypeError):
            BenefitProfile(str).get_companies()

    def test_get_benefit_companies_none_input(self):
        with self.assertRaises(TypeError):
            BenefitProfile(None).get_companies()

    def test_get_benefit_companies_empy_input(self):
        with self.assertRaises(TypeError):
            BenefitProfile().get_companies()

    def test_get_benefit_companies_boolean_input(self):
        with self.assertRaises(TypeError):
            BenefitProfile(True).get_companies()
 def test_get_benefit_data_types_company_doesnt_exist(self):
     with self.assertRaises(Exception):
         BenefitProfile(9999).get_data_types()
 def test_get_benefit_companies_string_input(self):
     with self.assertRaises(TypeError):
         BenefitProfile("1").get_companies()
 def test_get_benefit_data_types_boolean_input(self):
     with self.assertRaises(TypeError):
         BenefitProfile(True).get_data_types()
 def test_get_benefit_companies_float_input(self):
     with self.assertRaises(TypeError):
         BenefitProfile(1.3).get_companies()
    def setUp(self):
        call("./setup/start_testing.sh")

        self.profile_one = BenefitProfile(1)
        self.profile_two = BenefitProfile(2)
        self.profile_three = BenefitProfile(3)

        self.profile_one_data = {
            "id":
            1,
            "name":
            "Plano de Saúde Norte Europa",
            "companies": [{
                "idCompany": 3,
                "name": "Acme Co"
            }, {
                "idCompany": 1,
                "name": "Wonka Industries"
            }],
            "data_types": [{
                "idDatatype": 1,
                "name": "Nome",
                "example": "Ex. Ronaldo Farias Azevedo"
            }, {
                "idDatatype":
                2,
                "name":
                "CPF",
                "example":
                "Digite o número do CPF no padrão. Ex. 000.000.000-00"
            }, {
                "idDatatype": 3,
                "name": "Data Admissão",
                "example": "Este dado é gerado automaticamente"
            }, {
                "idDatatype": 8,
                "name": "Email",
                "example": "Ex. [email protected]"
            }]
        }
        self.profile_two_data = {
            "id":
            2,
            "name":
            "Plano de Saúde Pampulha Intermédica",
            "companies": [{
                "idCompany": 2,
                "name": "Tio Patinhas Bank"
            }, {
                "idCompany": 1,
                "name": "Wonka Industries"
            }],
            "data_types": [{
                "idDatatype": 1,
                "name": "Nome",
                "example": "Ex. Ronaldo Farias Azevedo"
            }, {
                "idDatatype":
                2,
                "name":
                "CPF",
                "example":
                "Digite o número do CPF no padrão. Ex. 000.000.000-00"
            }, {
                "idDatatype": 3,
                "name": "Data Admissão",
                "example": "Este dado é gerado automaticamente"
            }, {
                "idDatatype":
                4,
                "name":
                "Endereço",
                "example":
                "Ex. Av. Rebouças, 1020, ap 23, São Paulo - SP"
            }]
        }
        self.profile_three_data = {
            "id":
            3,
            "name":
            "Plano Dental Sorriso",
            "companies": [{
                "idCompany": 3,
                "name": "Acme Co"
            }, {
                "idCompany": 2,
                "name": "Tio Patinhas Bank"
            }, {
                "idCompany": 1,
                "name": "Wonka Industries"
            }],
            "data_types": [{
                "idDatatype": 1,
                "name": "Nome",
                "example": "Ex. Ronaldo Farias Azevedo"
            }, {
                "idDatatype":
                2,
                "name":
                "CPF",
                "example":
                "Digite o número do CPF no padrão. Ex. 000.000.000-00"
            }, {
                "idDatatype": 5,
                "name": "Peso (kg)",
                "example": "Digite somente os números. Ex. 75"
            }, {
                "idDatatype":
                6,
                "name":
                "Altura (cm)",
                "example":
                "Digite somente os números em centímetros. Ex. 175"
            }]
        }
 def test_get_benefit_companies_datatype_input(self):
     with self.assertRaises(TypeError):
         BenefitProfile(str).get_companies()