def test_RawFilter_search(self): filter_ = dict(ids=dict(type="my_type", values=["1", "4", "100"])) filter_string = json.dumps(filter_) self.assertEqual(Search(filter=RawFilter(filter_)).serialize(), dict(filter=filter_)) self.assertEqual(Search(filter=RawFilter(filter_string)).serialize(), dict(filter=filter_))
def test_RawFilter_string(self): filter_ = dict(ids=dict(type="my_type", values=["1", "4", "100"])) filter_string = json.dumps(filter_) self.assertEqual(RawFilter(filter_string), RawFilter(filter_string)) self.assertEqual(RawFilter(filter_string), RawFilter(filter_)) self.assertEqual(RawFilter(filter_string).serialize(), filter_) self.assertEqual(RawFilter(filter_string).serialize(), IdsFilter(type="my_type", values=["1", "4", "100"]).serialize())