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