コード例 #1
0
ファイル: test_validators.py プロジェクト: renatofb/weblate
 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
ファイル: test_validators.py プロジェクト: renatofb/weblate
 def test_syntax(self):
     with self.assertRaises(ValidationError):
         validate_re("(Min|Short")
     validate_re("(Min|Short)")
コード例 #4
0
ファイル: test_validators.py プロジェクト: renatofb/weblate
 def test_empty(self):
     with self.assertRaises(ValidationError):
         validate_re("(Min|Short|)$", allow_empty=False)
     validate_re("(Min|Short)$", allow_empty=False)
コード例 #5
0
ファイル: forms.py プロジェクト: supersaiyanslayin420/weblate
 def clean_match(self):
     match = self.cleaned_data["match"]
     validate_re(match, ("component", "language"))
     return match
コード例 #6
0
ファイル: test_validators.py プロジェクト: tdelmas/weblate
 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