Exemplo n.º 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
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)