'Query Mongo for docs in a timestamp range.
We use API and DocManager\'s search(start_ts,end_ts), and then compare.'

def test_search(self):

    docc = {'_id': '1', 'name': 'John'}
    self.choosy_docman.upsert(docc, 'test.test_include1', 5767301236327972865)
    docc2 = {'_id': '2', 'name': 'John    Paul'}
    self.choosy_docman.upsert(docc2, 'test.test_include1', 5767301236327972866)
    docc3 = {'_id': '3', 'name': 'Paul'}
    self.choosy_docman.upsert(docc3, 'test.test_include1', 5767301236327972870)
    search = list(self.choosy_docman.search(5767301236327972865, 5767301236327972866))
    self.assertEqual(len(search), 2)
    result_id = [result.get(self.id_field) for result in search]
    self.assertIn('1', result_id)
    self.assertIn('2', result_id)
