Repository: python-telegram-bot/python-telegram-bot

Issue:
telegram.Message.MESSAGE_TYPES does not contain "left_chat_member"
### Steps to reproduce
1. Look in source at `telegram.message:Message.MESSAGE_TYPES` :)

### Expected behaviour
There should be "left_chat_member"

### Actual behaviour
There is no "left_chat_member"

### Configuration
PTB from master branch dated by Feb 03 2019


Discussion:

Resolving patch:
diff --git a/telegram/message.py b/telegram/message.py
--- a/telegram/message.py
+++ b/telegram/message.py
@@ -209,10 +209,11 @@ class Message(TelegramObject):
     ATTACHMENT_TYPES = ['audio', 'game', 'animation', 'document', 'photo', 'sticker', 'video',
                         'voice', 'video_note', 'contact', 'location', 'venue', 'invoice',
                         'successful_payment']
-    MESSAGE_TYPES = ['text', 'new_chat_members', 'new_chat_title', 'new_chat_photo',
-                     'delete_chat_photo', 'group_chat_created', 'supergroup_chat_created',
-                     'channel_chat_created', 'migrate_to_chat_id', 'migrate_from_chat_id',
-                     'pinned_message', 'passport_data'] + ATTACHMENT_TYPES
+    MESSAGE_TYPES = ['text', 'new_chat_members', 'left_chat_member', 'new_chat_title',
+                     'new_chat_photo', 'delete_chat_photo', 'group_chat_created',
+                     'supergroup_chat_created', 'channel_chat_created', 'migrate_to_chat_id',
+                     'migrate_from_chat_id', 'pinned_message',
+                     'passport_data'] + ATTACHMENT_TYPES
 
     def __init__(self,
                  message_id,


Test patch:
diff --git a/tests/test_helpers.py b/tests/test_helpers.py
--- a/tests/test_helpers.py
+++ b/tests/test_helpers.py
@@ -32,24 +32,33 @@ def test_escape_markdown(self):
         assert expected_str == helpers.escape_markdown(test_str)
 
     def test_effective_message_type(self):
-        test_message = Message(message_id=1,
-                               from_user=None,
-                               date=None,
-                               chat=None)
 
-        test_message.text = 'Test'
+        def build_test_message(**kwargs):
+            config = dict(
+                message_id=1,
+                from_user=None,
+                date=None,
+                chat=None,
+            )
+            config.update(**kwargs)
+            return Message(**config)
+
+        test_message = build_test_message(text='Test')
         assert helpers.effective_message_type(test_message) == 'text'
         test_message.text = None
 
-        test_message.sticker = Sticker('sticker_id', 50, 50)
+        test_message = build_test_message(sticker=Sticker('sticker_id', 50, 50))
         assert helpers.effective_message_type(test_message) == 'sticker'
         test_message.sticker = None
 
-        test_message.new_chat_members = [User(55, 'new_user', False)]
+        test_message = build_test_message(new_chat_members=[User(55, 'new_user', False)])
         assert helpers.effective_message_type(test_message) == 'new_chat_members'
 
+        test_message = build_test_message(left_chat_member=[User(55, 'new_user', False)])
+        assert helpers.effective_message_type(test_message) == 'left_chat_member'
+
         test_update = Update(1)
-        test_message.text = 'Test'
+        test_message = build_test_message(text='Test')
         test_update.message = test_message
         assert helpers.effective_message_type(test_update) == 'text'