Ejemplo n.º 1
0
 def test_groups(self):
     with self.assertRaises(ValidationError):
         validate_re("(Min|Short)", ("component", ))
     validate_re("(?P<component>Min|Short)", ("component", ))
Ejemplo n.º 2
0
 def clean_match(self):
     match = self.cleaned_data['match']
     validate_re(match, ('component', 'language'))
     return match
Ejemplo n.º 3
0
 def test_syntax(self):
     with self.assertRaises(ValidationError):
         validate_re("(Min|Short")
     validate_re("(Min|Short)")
Ejemplo n.º 4
0
 def test_empty(self):
     with self.assertRaises(ValidationError):
         validate_re("(Min|Short|)$", allow_empty=False)
     validate_re("(Min|Short)$", allow_empty=False)
Ejemplo n.º 5
0
 def clean_match(self):
     match = self.cleaned_data["match"]
     validate_re(match, ("component", "language"))
     return match
Ejemplo n.º 6
0
 def test_groups(self):
     with self.assertRaises(ValidationError):
         validate_re('(Min|Short)', ('component', ))
     validate_re('(?P<component>Min|Short)', ('component', ))
Ejemplo n.º 7
0
 def clean_match(self):
     match = self.cleaned_data['match']
     validate_re(match, ('component', 'language'))
     return match