Ejemplo n.º 1
0
 def test_invalid_scheme(self):
     with self.assertRaises(ValidationError):
         validate_editor("javascript:alert(0)")
     with self.assertRaises(ValidationError):
         validate_editor("javaScript:alert(0)")
     with self.assertRaises(ValidationError):
         validate_editor(" javaScript:alert(0)")
Ejemplo n.º 2
0
 def test_invalid_scheme(self):
     with self.assertRaises(ValidationError):
         validate_editor('javascript:alert(0)')
     with self.assertRaises(ValidationError):
         validate_editor('javaScript:alert(0)')
     with self.assertRaises(ValidationError):
         validate_editor(' javaScript:alert(0)')
Ejemplo n.º 3
0
 def test_no_scheme(self):
     with self.assertRaises(ValidationError):
         validate_editor("./local/url")
Ejemplo n.º 4
0
 def test_invalid_format(self):
     with self.assertRaises(ValidationError):
         validate_editor("editor://open/?file={{ fle }}&line={{ line }}")
Ejemplo n.º 5
0
 def test_old_format(self):
     with self.assertRaises(ValidationError):
         validate_editor("editor://open/?file=%(file)s&line=%(line)s")
Ejemplo n.º 6
0
 def test_valid(self):
     self.assertIsNone(
         validate_editor(
             "editor://open/?file={{ filename }}&line={{ line }}"))
Ejemplo n.º 7
0
 def test_empty(self):
     self.assertIsNone(validate_editor(""))
Ejemplo n.º 8
0
 def test_no_scheme(self):
     with self.assertRaises(ValidationError):
         validate_editor('./local/url')
Ejemplo n.º 9
0
 def test_invalid_format(self):
     with self.assertRaises(ValidationError):
         validate_editor('editor://open/?file={{ fle }}&line={{ line }}')
Ejemplo n.º 10
0
 def test_old_format(self):
     with self.assertRaises(ValidationError):
         validate_editor('editor://open/?file=%(file)s&line=%(line)s')
Ejemplo n.º 11
0
 def test_valid(self):
     self.assertIsNone(validate_editor(
         'editor://open/?file={{ filename }}&line={{ line }}'
     ))
Ejemplo n.º 12
0
 def test_empty(self):
     self.assertIsNone(validate_editor(''))