Beispiel #1
0
 def content_count(self):
     return len((
         # we always want to call SMSMessageTemplate.__str__ regardless of subclass, to avoid any html formatting
         SMSMessageTemplate.__str__(self)
         if self._values
         else gsm_encode(add_prefix(self.content.strip(), self.prefix))
     ).encode(self.encoding))
Beispiel #2
0
def test_gsm_encode():
    assert gsm_encode('aàá…') == 'aàa...'
Beispiel #3
0
 def content_count(self):
     return len((str(self) if self._values else gsm_encode(
         add_prefix(self.content.strip(), self.prefix))).encode(
             self.encoding))