Ejemplo n.º 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%')))
Ejemplo n.º 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%'))
         )
Ejemplo n.º 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))
Ejemplo n.º 4
0
 def test_name_ok(self):
     """Test message ok with %name%."""
     less_than_sms_char_limit('test %name%')
Ejemplo n.º 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))
Ejemplo n.º 6
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))
Ejemplo n.º 7
0
 def test_name_ok(self):
     """Test message ok with %name%."""
     less_than_sms_char_limit('test %name%')
Ejemplo n.º 8
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))