def create_claim_2(claimant_information):
    nino = claimant_information['nino']
    employee_record = cabinet_api.employee_via_nino(nino)
    if employee_record:
        claim_id = cabinet_api.add_claim(
            claimant_information,
            employee_record
        )
        return claim_id
    else:
        raise NoEmployeeException(
            "Can't create a claim without first creating an employee")
示例#2
0
 def test_ninos_are_case_insensitive(self):
     employee_dict = {
         "employee_national_insurance_number": 'AB123456C',
         "employee_date_of_birth": "2012/1/1",
         "employee_title": "Mr",
         "employee_forenames": "Donald Duck",
         "employee_surname": "Quack",
         "employer_name": "McDuck Enterprises"
     }
     add_rp14a_form(employee_dict)
     employee = employee_via_nino('ab123456c')
     assert_that(employee, is_(employee_dict))
示例#3
0
 def test_employee_via_nino(self):
     nino = "AB123456C"
     employee_dict = {
         "employee_national_insurance_number": nino,
         "employee_date_of_birth": "2012/1/1",
         "employee_title": "Mr",
         "employee_forenames": "Donald Duck",
         "employee_surname": "Quack",
         "employer_name": "McDuck Enterprises"
     }
     add_rp14a_form(employee_dict)
     employee = employee_via_nino(nino)
     assert_that(employee, is_(employee_dict))
示例#4
0
 def test_employee_via_nino(self):
     nino = "AB123456C"
     employee_dict = {
         "employee_national_insurance_number": nino,
         "employee_date_of_birth": "2012/1/1",
         "employee_title": "Mr",
         "employee_forenames": "Donald Duck",
         "employee_surname": "Quack",
         "employer_name": "McDuck Enterprises"
     }
     add_rp14a_form(employee_dict)
     employee = employee_via_nino(nino)
     assert_that(employee, is_(employee_dict))
def step(context):
    nino = context.form_data["employee_national_insurance_number"]
    employee = employee_via_nino(nino)
    assert_that(employee, is_(not_none()))
示例#6
0
def employee_records():
    try:
        employee_record = employee_via_nino(request.args['nino'])
        return render_template('employee_record.html', employee_record=employee_record)
    except KeyError:
        return render_template('employee_record.html')
def step(context):
    nino = context.form_data["employee_national_insurance_number"]
    employee = employee_via_nino(nino)
    assert_that(employee, is_(not_none()))