@@ -17,35 +17,28 @@ def test2_create_draft_message(self):
17
17
self .assertIsNotNone (draft_message .id )
18
18
self .__class__ .target_message = draft_message
19
19
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
-
27
20
# def test4_create_reply(self):
28
21
# message = self.__class__.target_message.create_reply().execute_query()
29
22
# self.assertIsNotNone(message.resource_path)
30
23
31
24
# def test4_forward_message(self):
32
25
# self.__class__.target_message.forward([test_user_principal_name_alt]).execute_query()
33
26
34
- def test_5_get_my_messages (self ):
27
+ def test5_get_my_messages (self ):
35
28
messages = self .client .me .messages .top (1 ).get ().execute_query ()
36
29
self .assertLessEqual (1 , len (messages ))
37
30
self .assertIsNotNone (messages [0 ].resource_path )
38
31
39
- def test_6_update_message (self ):
32
+ def test6_update_message (self ):
40
33
message_to_update = self .__class__ .target_message
41
34
message_to_update .body = "The new cafeteria is close."
42
35
message_to_update .update ().execute_query ()
43
36
44
- def test_7_delete_message (self ):
37
+ def test7_delete_message (self ):
45
38
message_to_delete = self .__class__ .target_message
46
39
message_to_delete .delete_object ().execute_query ()
47
40
48
- def test_8_create_draft_message_with_attachments (self ):
41
+ def test8_create_draft_message_with_attachments (self ):
49
42
content = base64 .b64encode (
50
43
io .BytesIO (b"This is some file content" ).read ()
51
44
).decode ()
@@ -63,3 +56,12 @@ def test_8_create_draft_message_with_attachments(self):
63
56
== 2
64
57
)
65
58
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