def test_auto_offset(self):
with open('tests/rets_responses/COMPACT-DECODED/Search_1of2.xml') as f:
search1_contents = ''.join(f.readlines())
with open('tests/rets_responses/COMPACT-DECODED/Search_2of2.xml') as f:
search2_contents = ''.join(f.readlines())
with responses.RequestsMock() as resps:
resps.add(resps.POST, 'http://server.rets.com/rets/Search.ashx',
body=search1_contents, status=200, stream=True)
resps.add(resps.POST, 'http://server.rets.com/rets/Search.ashx',
body=search2_contents, status=200, stream=True)
results = self.session.search(resource='Property',
resource_class='RES',
search_filter={'ListingPrice': 200000})
self.assertEqual(len(results), 6)
评论列表
文章目录