コード例 #1
0
 def test_no_name_raises(self):
     """Test shorter limit imposed with %name% present."""
     s = SiteConfiguration.get_solo()
     with pytest.raises(ValidationError):
         less_than_sms_char_limit(
             't %name%' *
             (s.sms_char_limit - settings.MAX_NAME_LENGTH + len('%name%')))
コード例 #2
0
 def test_no_name_raises(self):
     """Test shorter limit imposed with %name% present."""
     s = SiteConfiguration.get_solo()
     with pytest.raises(ValidationError):
         less_than_sms_char_limit(
             't %name%' *
             (s.sms_char_limit - settings.MAX_NAME_LENGTH + len('%name%'))
         )
コード例 #3
0
 def test_no_name_raises(self):
     """Test raises error with no %name% sub."""
     s = SiteConfiguration.get_solo()
     with pytest.raises(ValidationError):
         less_than_sms_char_limit('t' * (s.sms_char_limit + 1))
コード例 #4
0
 def test_name_ok(self):
     """Test message ok with %name%."""
     less_than_sms_char_limit('test %name%')
コード例 #5
0
 def test_no_name_ok(self):
     """Test message ok."""
     s = SiteConfiguration.get_solo()
     less_than_sms_char_limit('t' * (s.sms_char_limit - 1))
コード例 #6
0
ファイル: test_validators.py プロジェクト: nikolay/apostello
 def test_no_name_raises(self):
     """Test raises error with no %name% sub."""
     s = SiteConfiguration.get_solo()
     with pytest.raises(ValidationError):
         less_than_sms_char_limit('t' * (s.sms_char_limit + 1))
コード例 #7
0
ファイル: test_validators.py プロジェクト: nikolay/apostello
 def test_name_ok(self):
     """Test message ok with %name%."""
     less_than_sms_char_limit('test %name%')
コード例 #8
0
ファイル: test_validators.py プロジェクト: nikolay/apostello
 def test_no_name_ok(self):
     """Test message ok."""
     s = SiteConfiguration.get_solo()
     less_than_sms_char_limit('t' * (s.sms_char_limit - 1))