| 82 | # ============================================================ |
| 83 | |
| 84 | class TestDelattr834: |
| 85 | def test_tainted_attr_name_fires(self): |
| 86 | code = """ |
| 87 | attr = request.GET.get('field') |
| 88 | delattr(obj, attr) |
| 89 | """ |
| 90 | assert fires(code, "DELATTR834"), "DELATTR834 must fire: tainted attr name to delattr" |
| 91 | |
| 92 | def test_constant_attr_safe(self): |
| 93 | code = """ |
| 94 | delattr(obj, 'cache') |
| 95 | """ |
| 96 | assert not fires(code, "DELATTR834"), "DELATTR834 must NOT fire for constant attr" |
| 97 | |
| 98 | |
| 99 | # ============================================================ |
nothing calls this directly
no outgoing calls
no test coverage detected