def test_search_for_profile_0_chars(self): Profile.create_new_user('uniquetestuser', '*****@*****.**', 'password1', date.today()) with self.assertRaises( InvalidSearchException ): # Verify that exception is raised, as it should be Profile.search( '') # A search with 0 characters should throw an exception
def test_search_users(self): Profile.create_new_user('uniquetestuser', '*****@*****.**', 'password1', date.today()) found = Profile.search('uniquetest') #for profile in found: # user = profile.user self.assertTrue(len(found) > 0)
def test_search_for_profile_9999999_chars(self): Profile.create_new_user('uniquetestuser', '*****@*****.**', 'password1', date.today()) with self.assertRaises(InvalidSearchException): Profile.search('t' * 9999999)
def test_search_for_profile_2000_chars(self): Profile.create_new_user('uniquetestuser', '*****@*****.**', 'password1', date.today()) profile = Profile.search('t' * 2000) self.assertTrue(len(profile) == 0)
def test_search_for_profile_0_chars(self): Profile.create_new_user('uniquetestuser', '*****@*****.**', 'password1', date.today()) with self.assertRaises(InvalidSearchException): # Verify that exception is raised, as it should be Profile.search('') # A search with 0 characters should throw an exception