add tests for comment attacks

This commit is contained in:
Omer Lachish 2018-11-21 13:52:08 +02:00
parent 14860f6a8b
commit ef8839aafa

View File

@ -88,4 +88,8 @@ class TestSQLQuery(TestCase):
self.assertFalse(query.is_safe())
def test_marks_comment_attacks_as_not_safe(self):
query = SQLQuery("SELECT * FROM users WHERE username='{{username}}' AND password='{{password}}'")
query.apply({"username": "admin' --"})
self.assertFalse(query.is_safe())