def test_address_with_no_comma_before_postcode4(self): address = address_utils.format_address_string( "Dunroamin, 58 Newstead Road, Leicester le3 0sa, Leicestershire") self.assertEqual(address, [ "Dunroamin", "58 Newstead Road", "Leicester", "Leicestershire", "LE3 0SA" ])
def do_search_deed_search(): deed_data = lookup_deed(session['deed_token']) if deed_data is not None: if 'effective_date' in deed_data["deed"]: temp = datetime.datetime.strptime(deed_data["deed"]["effective_date"], "%Y-%m-%d %H:%M:%S") deed_data["deed"]["effective_date"] = temp.strftime("%d/%m/%Y at %H:%M:%S") # Akuma Check res = Akuma.do_check(deed_data, "borrower view", session['borrower_token'], session['deed_token']) if res["result"] == "Z": conveyancer = get_conveyancer_for_deed(session['deed_token']) session.clear() return render_template('unabletoproceed.html', conveyancer=conveyancer) deed_data["deed"]["property_address"] = format_address_string(deed_data["deed"]["property_address"]) session['no_of_borrowers'] = no_of_borrowers(deed_data) if deed_signed(): response = render_template('viewdeed.html', deed_data=deed_data, signed=True, conveyancer=get_conveyancer_for_deed(session['deed_token'])) else: response = render_template('viewdeed.html', deed_data=deed_data, signed=False, conveyancer=get_conveyancer_for_deed(session['deed_token'])) else: return render_template('searchdeed.html', error=True) return response
def do_search_deed_search(): deed_data = lookup_deed(session['deed_token']) if deed_data is not None: deed_data["deed"]["property_address"] = format_address_string(deed_data["deed"]["property_address"]) if deed_signed(): response = render_template('viewdeed.html', deed_data=deed_data, signed=True) else: response = render_template('viewdeed.html', deed_data=deed_data, signed=False) else: return render_template('searchdeed.html', error=True) return response
def do_search_deed_search(): deed_data = lookup_deed(session['deed_token']) if deed_data is not None: deed_data["deed"]["property_address"] = format_address_string( deed_data["deed"]["property_address"]) if deed_signed(): response = render_template('viewdeed.html', deed_data=deed_data, signed=True) else: response = render_template('viewdeed.html', deed_data=deed_data, signed=False) else: return render_template('searchdeed.html', error=True) return response
def test_format_address(self): address = address_utils.format_address_string("103 street name, the town, the city,PL5 9ZZ") self.assertEqual(address, ["103 street name", "the town", "the city", "PL5 9ZZ"])
def test_address_with_no_comma_before_postcode3(self): address = address_utils.format_address_string("Dunroamin, 999 Fake Road, Leicester, Leicestershire LE3 0SA") self.assertEqual(address, ["Dunroamin", "999 Fake Road", "Leicester", "Leicestershire", "LE3 0SA"])
def test_address_with_no_comma_before_postcode2(self): address = address_utils.format_address_string("999b Fake Road, Leicester, Leicestershire le3 0sa") self.assertEqual(address, ["999b Fake Road", "Leicester", "Leicestershire", "LE3 0SA"])
def test_address_with_no_commas(self): address = address_utils.format_address_string("999 Fake Road Leicester Leicestershire LE3 0SA") self.assertEqual(address, ["999 Fake Road Leicester Leicestershire", "LE3 0SA"])
def test_format_combined(self): address = address_utils.format_address_string("103, street name , the town , the city , pl6 9zz ") self.assertEqual(address, ["103 street name", "the town", "the city", "PL6 9ZZ"])
def test_format_address_lowercase_postcode(self): address = address_utils.format_address_string("103 street name , the town, the city, pl6 9zz") self.assertEqual(address, ["103 street name", "the town", "the city", "PL6 9ZZ"])
def test_format_address_with_post_code_in_wrong_place(self): address = address_utils.format_address_string("103 street name , the town, PL5 9ZZ ,the city") self.assertEqual(address, ["103 street name", "the town", "the city", "PL5 9ZZ"])
def test_format_address_with_comma_after_house_number(self): address = address_utils.format_address_string("103,street name, the town, the city,PL5 9ZZ") self.assertEqual(address, ["103 street name", "the town", "the city", "PL5 9ZZ"])
def test_format_address_with_whitespace(self): address = address_utils.format_address_string( "103 street name , the town, the city , PL6 5WS ") self.assertEqual( address, ["103 street name", "the town", "the city", "PL6 5WS"])