Exemple #1
0
 def test_list_contacts(self):
     ''' 
         Verify that the list contacts method returns the list of the user clients
         as a list of (id, contact) tuples
     
      '''
     user1 = helpers.create_dummy_user(11)
     user2 = helpers.create_dummy_user(12)
     
     create_dummy_client(1, user1)
     create_dummy_client(2, user2)
     create_dummy_client(3, user1)
     create_dummy_client(4, user2)
     create_dummy_client(5, user1)
     create_dummy_client(6, user2)
     create_dummy_client(7, user1)
      
     client_manager_1 = ClientManager(user1)
     client_manager_2 = ClientManager(user2)
      
     clients_1 = client_manager_1.list_clients()
     clients_2 = client_manager_2.list_clients()
      
     self.assertEqual(len(clients_1), 4)
     self.assertEqual(len(clients_2), 3)
     
Exemple #2
0
 def _execute(self):
     client_manager = ClientManager(self._user_session.get_user())
     clients = client_manager.list_clients()
     json = self.jsonize_jqgrid(clients)
     return self.render_content(json)