def test_RawFilter_dict(self): filter_ = dict(ids=dict(type="my_type", values=["1", "4", "100"])) self.assertEqual(RawFilter(filter_), RawFilter(filter_)) self.assertEqual(RawFilter(filter_).serialize(), filter_) self.assertEqual( RawFilter(filter_).serialize(), IdsFilter(type="my_type", values=["1", "4", "100"]).serialize())
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())