Fixed includes for poll objects
authorKiet Nguyen <kanguyen.vn@gmail.com>
Fri, 17 Dec 2021 23:26:05 +0000 (18:26 -0500)
committerKiet Nguyen <kanguyen.vn@gmail.com>
Fri, 17 Dec 2021 23:26:05 +0000 (18:26 -0500)
tweepy/client.py

index 0da5dae4aa246ab80c78170c4400be96bdc633d1..9f7ee600ca52c9e2fcc93ca7c166ccfdc9a1016f 100644 (file)
@@ -155,7 +155,8 @@ class Client:
             elif isinstance(param_value, datetime.datetime):
                 if param_value.tzinfo is not None:
                     param_value = param_value.astimezone(datetime.timezone.utc)
-                request_params[param_name] = param_value.strftime("%Y-%m-%dT%H:%M:%S.%fZ")
+                request_params[param_name] = param_value.strftime(
+                    "%Y-%m-%dT%H:%M:%S.%fZ")
                 # TODO: Constant datetime format string?
             else:
                 request_params[param_name] = param_value
@@ -186,7 +187,7 @@ class Client:
             includes["media"] = [Media(media) for media in includes["media"]]
         if "places" in includes:
             includes["places"] = [Place(place) for place in includes["places"]]
-        if "poll" in includes:
+        if "polls" in includes:
             includes["polls"] = [Poll(poll) for poll in includes["polls"]]
         if "tweets" in includes:
             includes["tweets"] = [Tweet(tweet) for tweet in includes["tweets"]]
@@ -2499,7 +2500,7 @@ class Client:
             "GET", route, params=params,
             endpoint_parameters=(
                 "expansions", "list.fields", "user.fields"
-            ), data_type=List, user_auth = True
+            ), data_type=List, user_auth=True
         )
 
     def pin_list(self, list_id):