MCPcopy Create free account
hub / github.com/ParzivalHack/PySpector / TestSer522

Class TestSer522

tests/unit/test_group_a_rules.py:228–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226# ============================================================
227
228class TestSer522:
229 def test_tainted_object_fires(self):
230 code = """
231 data = request.POST.get('data')
232 result = serialize('json', data)
233 """
234 assert fires(code, "SER522"), "SER522 must fire: tainted object to serialize()"
235
236 def test_constant_object_safe(self):
237 code = """
238 result = serialize('json', MyModel.objects.all())
239 """
240 assert not fires(code, "SER522"), "SER522 must NOT fire for untainted queryset"
241
242
243# ============================================================

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected