if company.is_expired: status = f'EXPIRED on {company.get_exp_date_str()}' else: status = f'Expiry date: {company.get_exp_date_str()}' print(f'{company} - {status} {company.tte_days} to expiry') print() #creds smtphost = 'smtp.mail.yahoo.com' sender_email = '*****@*****.**' sender_pw = 'hcsxjloxlclhpejl' port = 465 sender = MailSender(sender_email, sender_pw, smtphost, port) #ehlo the server sender.connect() email_txts = {42: {'company': [], 'txt': '6wks.txt'}, 14: {'company': [], 'txt': '2wks.txt'},\ 0: {'company': [], 'txt':'today.txt'}} ##test cases testcomp1 = {'license': 'PE123456', 'name': 'testcomp1', 'expiry_date': '26/01/2021', \ 'email': '*****@*****.**'} companies.append(database.Company(testcomp1)) testcomp2 = {'license': 'PE123457', 'name': 'testcomp2', 'expiry_date': '9/2/2021', \ 'email': '*****@*****.**'} companies.append(database.Company(testcomp2)) print(companies[-1].tte_days)