File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
src/vonage_messages/models Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ class BaseRcs(BaseMessage):
3030 """
3131
3232 to : PhoneNumber
33- from_ : str = Field (..., serialization_alias = 'from' , pattern = '^[a-zA-Z0-9-_]+$' )
33+ from_ : str = Field (..., serialization_alias = 'from' , pattern = '^[a-zA-Z0-9-_& ]+$' )
3434 ttl : Optional [int ] = Field (None , ge = 300 , le = 259200 )
3535 channel : ChannelType = ChannelType .RCS
3636
Original file line number Diff line number Diff line change @@ -25,6 +25,27 @@ def test_create_rcs_text():
2525 assert rcs_model .model_dump (by_alias = True , exclude_none = True ) == rcs_dict
2626
2727
28+ def test_create_rcs_text_with_ampersand ():
29+ """Tests that RCS from fields will allow an ampersand (&) character.
30+
31+ See also: DEVX-10155
32+ """
33+ rcs_model = RcsText (
34+ to = '1234567890' ,
35+ from_ = 'Acme&SonsCo' ,
36+ text = 'Hello, World!' ,
37+ )
38+ rcs_dict = {
39+ 'to' : '1234567890' ,
40+ 'from' : 'Acme&SonsCo' ,
41+ 'text' : 'Hello, World!' ,
42+ 'channel' : 'rcs' ,
43+ 'message_type' : 'text' ,
44+ }
45+
46+ assert rcs_model .model_dump (by_alias = True , exclude_none = True ) == rcs_dict
47+
48+
2849def test_create_rcs_text_all_fields ():
2950 rcs_model = RcsText (
3051 to = '1234567890' ,
You can’t perform that action at this time.
0 commit comments