def test_find_by_site_name(self): ''' Test to check if we can find a credential by site_name ''' self.new_credential.save_credentials() test_fb = Credential('Joseph', 'facebook', 'josylad', '123456') test_fb.save_credentials() credential_exists = Credential.find_by_site_name('facebook') self.assertEqual(credential_exists, test_fb)
def find_credential(site_name): ''' Function that finds a contact by number and returns the contact ''' return Credential.find_by_site_name(site_name)
def check_existing_site(site_name): ''' Function that check if a credential exists with that site_name and return a Boolean ''' return Credential.find_by_site_name(site_name)