def test_groups(self): with self.assertRaises(ValidationError): validate_re("(Min|Short)", ("component", )) validate_re("(?P<component>Min|Short)", ("component", ))
def clean_match(self): match = self.cleaned_data['match'] validate_re(match, ('component', 'language')) return match
def test_syntax(self): with self.assertRaises(ValidationError): validate_re("(Min|Short") validate_re("(Min|Short)")
def test_empty(self): with self.assertRaises(ValidationError): validate_re("(Min|Short|)$", allow_empty=False) validate_re("(Min|Short)$", allow_empty=False)
def clean_match(self): match = self.cleaned_data["match"] validate_re(match, ("component", "language")) return match
def test_groups(self): with self.assertRaises(ValidationError): validate_re('(Min|Short)', ('component', )) validate_re('(?P<component>Min|Short)', ('component', ))
def clean_match(self): match = self.cleaned_data['match'] validate_re(match, ('component', 'language')) return match