@@ -17,35 +17,28 @@ def test2_create_draft_message(self):
1717 self .assertIsNotNone (draft_message .id )
1818 self .__class__ .target_message = draft_message
1919
20- def test3_send_message (self ):
21- message = self .__class__ .target_message
22- message .to_recipients .add (Recipient .from_email (test_user_principal_name ))
23- message .to_recipients .add (Recipient .from_email (test_user_principal_name_alt ))
24- message .body = "The new cafeteria is open."
25- message .update ().send ().execute_query ()
26-
2720 # def test4_create_reply(self):
2821 # message = self.__class__.target_message.create_reply().execute_query()
2922 # self.assertIsNotNone(message.resource_path)
3023
3124 # def test4_forward_message(self):
3225 # self.__class__.target_message.forward([test_user_principal_name_alt]).execute_query()
3326
34- def test_5_get_my_messages (self ):
27+ def test5_get_my_messages (self ):
3528 messages = self .client .me .messages .top (1 ).get ().execute_query ()
3629 self .assertLessEqual (1 , len (messages ))
3730 self .assertIsNotNone (messages [0 ].resource_path )
3831
39- def test_6_update_message (self ):
32+ def test6_update_message (self ):
4033 message_to_update = self .__class__ .target_message
4134 message_to_update .body = "The new cafeteria is close."
4235 message_to_update .update ().execute_query ()
4336
44- def test_7_delete_message (self ):
37+ def test7_delete_message (self ):
4538 message_to_delete = self .__class__ .target_message
4639 message_to_delete .delete_object ().execute_query ()
4740
48- def test_8_create_draft_message_with_attachments (self ):
41+ def test8_create_draft_message_with_attachments (self ):
4942 content = base64 .b64encode (
5043 io .BytesIO (b"This is some file content" ).read ()
5144 ).decode ()
@@ -63,3 +56,12 @@ def test_8_create_draft_message_with_attachments(self):
6356 == 2
6457 )
6558 draft .delete_object ().execute_query ()
59+
60+ def test9_send_message (self ):
61+ message = self .client .me .messages .add (
62+ subject = "Meet for lunch?" , body = "The new cafeteria is open."
63+ )
64+ message .to_recipients .add (Recipient .from_email (test_user_principal_name ))
65+ message .to_recipients .add (Recipient .from_email (test_user_principal_name_alt ))
66+ message .body = "The new cafeteria is open."
67+ message .update ().send ().execute_query ()
0 commit comments