예제 #1
0
 def test_groups(self):
     with self.assertRaises(ValidationError):
         validate_re("(Min|Short)", ("component", ))
     validate_re("(?P<component>Min|Short)", ("component", ))
예제 #2
0
파일: forms.py 프로젝트: tdelmas/weblate
 def clean_match(self):
     match = self.cleaned_data['match']
     validate_re(match, ('component', 'language'))
     return match
예제 #3
0
 def test_syntax(self):
     with self.assertRaises(ValidationError):
         validate_re("(Min|Short")
     validate_re("(Min|Short)")
예제 #4
0
 def test_empty(self):
     with self.assertRaises(ValidationError):
         validate_re("(Min|Short|)$", allow_empty=False)
     validate_re("(Min|Short)$", allow_empty=False)
예제 #5
0
 def clean_match(self):
     match = self.cleaned_data["match"]
     validate_re(match, ("component", "language"))
     return match
예제 #6
0
 def test_groups(self):
     with self.assertRaises(ValidationError):
         validate_re('(Min|Short)', ('component', ))
     validate_re('(?P<component>Min|Short)', ('component', ))
예제 #7
0
파일: forms.py 프로젝트: dekoza/weblate
 def clean_match(self):
     match = self.cleaned_data['match']
     validate_re(match, ('component', 'language'))
     return match