def test_query_no_connection_filter(self, mock_qry): User._default_connection = '' User.query() args, kwargs = mock_qry.call_args self.assertEqual(kwargs, {})
def test_v1_query(self, mock_qry): User.query(search_engine='v1') args, kwargs = mock_qry.call_args self.assertEqual(args[0], {'search_engine': 'v1'})
def test_unimplemented_query(self): with self.assertRaises(UnimplementedException): User.query(search_engine='v1', q='email:"bon@äcdc.com"')
def test_empty_query(self, mock_qry): User.query() args, kwargs = mock_qry.call_args self.assertEqual(kwargs['q'], {'identities.connection': 'test-conn'}) self.assertEqual(args[0]['search_engine'], 'v2')