def copy_email(cls, password): """ A funct that copies the email using the pyperclip framework We import the framework then declare a function that copies the emails. """ detail_found = Detail.find_by_password(password) pyperclip.copy(detail_found.email)
def test_find_detail_by_password(self): ''' test to check if we can find a detail by account password and display information ''' self.new_detail.save_detail() test_detail = Detail("Test", "user", "2222222222", "*****@*****.**") # new detail test_detail.save_detail() found_detail = Detail.find_by_password("2222222222") self.assertEqual(found_detail.email, test_detail.email)
def find_detail(password): """ Function that finds a detail by password and returns the detail """ return Detail.find_by_password(password)