@@ -110,7 +110,8 @@ def test_conversation_parts(self):
110110 # There is a part_type
111111 self .assertIsNotNone (part .part_type )
112112 # There is a body
113- self .assertIsNotNone (part .body )
113+ if not part .part_type == 'assignment' :
114+ self .assertIsNotNone (part .body )
114115
115116 def test_reply (self ):
116117 # REPLYING TO CONVERSATIONS
@@ -127,6 +128,32 @@ def test_reply(self):
127128 conversation = Conversation .find (id = self .admin_conv .id )
128129 self .assertEqual (num_parts + 2 , len (conversation .conversation_parts ))
129130
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+
130157 def test_mark_read (self ):
131158 # MARKING A CONVERSATION AS READ
132159 conversation = Conversation .find (id = self .admin_conv .id )
0 commit comments