def testCreateAutogeneratedMessage(self): """Tests that a message with no author is created properly.""" message = connection_logic.createConnectionMessage( self.connection.key, TEST_MESSAGE_CONTENT) self.assertIsNotNone(message) self.assertEqual(message.key.parent(), self.connection.key) self.assertEqual(message.content, TEST_MESSAGE_CONTENT) self.assertIsNone(message.author) self.assertTrue(message.is_auto_generated)
def testCreateAutogeneratedMessage(self): """Tests that a message with no author is created properly.""" message = connection_logic.createConnectionMessage( self.connection.key, TEST_MESSAGE_CONTENT) self.assertIsNotNone(message) self.assertEqual(message.key.parent(), self.connection.key) self.assertEqual(message.content, TEST_MESSAGE_CONTENT) self.assertIsNone(message.author) self.assertTrue(message.is_auto_generated)
def testCreateMessageWithAuthor(self): """Tests that a message with an author is created properly.""" message = connection_logic.createConnectionMessage( self.connection.key, TEST_MESSAGE_CONTENT, author_key=self.profile.key) self.assertIsNotNone(message) self.assertEqual(message.key.parent(), self.connection.key) self.assertEqual(message.content, TEST_MESSAGE_CONTENT) self.assertEqual(message.author, self.profile.key) self.assertFalse(message.is_auto_generated)
def testCreateMessageWithAuthor(self): """Tests that a message with an author is created properly.""" message = connection_logic.createConnectionMessage( self.connection.key, TEST_MESSAGE_CONTENT, author_key=self.profile.key) self.assertIsNotNone(message) self.assertEqual(message.key.parent(), self.connection.key) self.assertEqual(message.content, TEST_MESSAGE_CONTENT) self.assertEqual(message.author, self.profile.key) self.assertFalse(message.is_auto_generated)