Exemple #1
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
Exemple #2
0
 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)
Exemple #3
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)
Exemple #4
0
 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)
Exemple #5
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
Exemple #6
0
 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)
Exemple #7
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)
Exemple #8
0
 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)