Repository: ucfopen/canvasapi

Issue:
Update Canvas.get_todo_items to use Todo class
In #426, we created a new `Todo` class to wrap TODO items. This was so the newly-added `Course.get_todo_items()` functions properly with our current implementation of `PaginatedList`. As noted in that PR, we need to apply this same treatment to `Canvas.get_todo_items()`.

Discussion:
coveralls: 
[![Coverage Status](https://coveralls.io/builds/35476470/badge)](https://coveralls.io/builds/35476470)

Coverage remained the same at 100.0% when pulling **31bd37fd2b250c33f5efe924fd0bf7d512b1b0f5 on bennettscience:issue/444-todos-class** into **94d735ad6c691821e08966641fbeac6bb900ecf0 on ucfopen:develop**.


Patch:
diff --git a/canvasapi/canvas.py b/canvasapi/canvas.py
index 962106e..4737f7b 100644
--- a/canvasapi/canvas.py
+++ b/canvasapi/canvas.py
@@ -12,6 +12,7 @@ from canvasapi.group import Group, GroupCategory
 from canvasapi.paginated_list import PaginatedList
 from canvasapi.requester import Requester
 from canvasapi.section import Section
+from canvasapi.todo import Todo
 from canvasapi.user import User
 from canvasapi.util import combine_kwargs, get_institution_url, obj_or_id
 
@@ -1170,10 +1171,13 @@ class Canvas(object):
 
         :rtype: dict
         """
-        response = self.__requester.request(
-            "GET", "users/self/todo", _kwargs=combine_kwargs(**kwargs)
+        return PaginatedList(
+            Todo,
+            self.__requester,
+            "GET",
+            "users/self/todo",
+            _kwargs=combine_kwargs(**kwargs),
         )
-        return response.json()
 
     def get_upcoming_events(self, **kwargs):
         """


Test patch:
diff --git a/tests/test_canvas.py b/tests/test_canvas.py
index 87ec42a..2282d60 100644
--- a/tests/test_canvas.py
+++ b/tests/test_canvas.py
@@ -21,6 +21,7 @@ from canvasapi.outcome import Outcome, OutcomeGroup
 from canvasapi.paginated_list import PaginatedList
 from canvasapi.progress import Progress
 from canvasapi.section import Section
+from canvasapi.todo import Todo
 from canvasapi.user import User
 from tests import settings
 from tests.util import register_uris
@@ -240,8 +241,9 @@ class TestCanvas(unittest.TestCase):
         register_uris({"user": ["todo_items"]}, m)
 
         todo_items = self.canvas.get_todo_items()
+        todo_list = [todo for todo in todo_items]
 
-        self.assertIsInstance(todo_items, list)
+        self.assertIsInstance(todo_list[0], Todo)
 
     # get_upcoming_events()
     def test_get_upcoming_events(self, m):