| 226 | # ============================================================ |
| 227 | |
| 228 | class 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 | # ============================================================ |
nothing calls this directly
no outgoing calls
no test coverage detected