Beispiel #1
0
 def test_query_no_connection_filter(self, mock_qry):
     User._default_connection = ''
     User.query()
     args, kwargs = mock_qry.call_args
     self.assertEqual(kwargs, {})
Beispiel #2
0
 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'})
Beispiel #3
0
 def test_unimplemented_query(self):
     with self.assertRaises(UnimplementedException):
         User.query(search_engine='v1', q='email:"bon@äcdc.com"')
Beispiel #4
0
 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')