@@ -110,7 +110,8 @@ def test_conversation_parts(self):
110
110
# There is a part_type
111
111
self .assertIsNotNone (part .part_type )
112
112
# There is a body
113
- self .assertIsNotNone (part .body )
113
+ if not part .part_type == 'assignment' :
114
+ self .assertIsNotNone (part .body )
114
115
115
116
def test_reply (self ):
116
117
# REPLYING TO CONVERSATIONS
@@ -127,6 +128,32 @@ def test_reply(self):
127
128
conversation = Conversation .find (id = self .admin_conv .id )
128
129
self .assertEqual (num_parts + 2 , len (conversation .conversation_parts ))
129
130
131
+ def test_open (self ):
132
+ # OPENING CONVERSATIONS
133
+ conversation = Conversation .find (id = self .admin_conv .id )
134
+ conversation .close_conversation (admin_id = self .admin .id , body = 'Closing message' )
135
+ self .assertFalse (conversation .open )
136
+ conversation .open_conversation (admin_id = self .admin .id , body = 'Opening message' )
137
+ conversation = Conversation .find (id = self .admin_conv .id )
138
+ self .assertTrue (conversation .open )
139
+
140
+ def test_close (self ):
141
+ # CLOSING CONVERSATIONS
142
+ conversation = Conversation .find (id = self .admin_conv .id )
143
+ self .assertTrue (conversation .open )
144
+ conversation .close_conversation (admin_id = self .admin .id , body = 'Closing message' )
145
+ conversation = Conversation .find (id = self .admin_conv .id )
146
+ self .assertFalse (conversation .open )
147
+
148
+ def test_assignment (self ):
149
+ # ASSIGNING CONVERSATIONS
150
+ conversation = Conversation .find (id = self .admin_conv .id )
151
+ num_parts = len (conversation .conversation_parts )
152
+ conversation .assign (assignee_id = self .admin .id , admin_id = self .admin .id )
153
+ conversation = Conversation .find (id = self .admin_conv .id )
154
+ self .assertEqual (num_parts + 1 , len (conversation .conversation_parts ))
155
+ self .assertEqual ("assignment" , conversation .conversation_parts [- 1 ].part_type )
156
+
130
157
def test_mark_read (self ):
131
158
# MARKING A CONVERSATION AS READ
132
159
conversation = Conversation .find (id = self .admin_conv .id )
0 commit comments