def test_get_users_with_filters(self):
     mock_user = Mock(name='joe')
     dds_util = DDSUtil(user=Mock())
     mock_remote_store = Mock()
     mock_remote_store.data_service.get_users.return_value = [mock_user]
     dds_util._remote_store = mock_remote_store
     users = dds_util.get_users(full_name_contains='Joe', email='*****@*****.**', username='******')
     self.assertEqual(users, [mock_user])
     mock_remote_store.data_service.get_users.assert_called_with('Joe', '*****@*****.**', 'joe')
 def test_get_users_no_filter(self):
     mock_user = Mock(name='joe')
     dds_util = DDSUtil(user=Mock())
     mock_remote_store = Mock()
     mock_remote_store.data_service.get_users.return_value = [mock_user]
     dds_util._remote_store = mock_remote_store
     users = dds_util.get_users()
     self.assertEqual(users, [mock_user])
     mock_remote_store.data_service.get_users.assert_called_with(None, None, None)
Пример #3
0
 def test_get_users_no_filter(self):
     mock_user = Mock(name='joe')
     dds_util = DDSUtil(user=Mock())
     mock_remote_store = Mock()
     mock_remote_store.data_service.get_users.return_value = [mock_user]
     dds_util._remote_store = mock_remote_store
     users = dds_util.get_users()
     self.assertEqual(users, [mock_user])
     mock_remote_store.data_service.get_users.assert_called_with(
         None, None, None)
Пример #4
0
 def test_get_users_with_filters(self):
     mock_user = Mock(name='joe')
     dds_util = DDSUtil(user=Mock())
     mock_remote_store = Mock()
     mock_remote_store.data_service.get_users.return_value = [mock_user]
     dds_util._remote_store = mock_remote_store
     users = dds_util.get_users(full_name_contains='Joe',
                                email='*****@*****.**',
                                username='******')
     self.assertEqual(users, [mock_user])
     mock_remote_store.data_service.get_users.assert_called_with(
         'Joe', '*****@*****.**', 'joe')