Пример #1
0
    def testDeleteConversationWithoutOwner(self):
        c, msg = User.add_new_conversation(self.u1.username, self.u2.username,
            title_plain_text,
            content_plain_text)

        m = Conversation.add_new_message(self.u2.username,
            content_plain_text2, conv_key=c.key)

#        c.put()

        Conversation.delete_conversation(self.u2.username, key=c.key)

        conv = c.key.get()
        self.assertIsNotNone(conv, "Conversation is None")
        self.assertEqual(conv.deleted_for, self.u2.username,
            "Conversation not deleted for %s" % self.u2.username)

        for m in conv.messages:
            self.assertEqual(m.deleted_for, self.u2.username,
                "Message not deleted for %s" % self.u2.username)
Пример #2
0
    def testDeleteConversationWithOwner(self):
        c, msg = User.add_new_conversation(self.u1.username, self.u2.username,
            title_plain_text,
            content_plain_text)

        m = Conversation.add_new_message(self.u2.username,
            content_plain_text2, conv_key=c.key)

        message_keys = deepcopy(c.messages_list)

#        c.put()

        Conversation.delete_conversation(self.u1.username, key=c.key)

        conv = c.key.get()
        self.assertIsNone(conv, "Conversation is not None")

        for k in message_keys:
            msg = k.get()
            self.assertIsNone(msg, "Message is not None")