Repository: iiif-prezi/iiif-prezi3 (language: python)

Issue:
Make Canvas
<!-- Add a short name of the proposed helper method in the Title above -->

## Description
<!-- Provide a short description of the helper method -->
This helper will create a `Canvas` object, add it to the `items` property (by calling the `add_item` helper (#37)), and return it

## Function name / Parameters / Return
<!-- Suggest a name for the helper's function, the parameters it should accept, and what it should return (if anything) -->
Function name: `.make_canvas()`

Parameters: None

Returns: A `Canvas` object

## Objects
<!-- Which objects should this helper apply to? -->
- [ ] Base Object (all Prezi3 Classes)
- [ ] Collection
- [x] Manifest
- [ ] Canvas
- [ ] Range
- [ ] AnnotationCollection
- [ ] AnnotationPage
- [ ] Annotation
- [ ] Content Resource - Image
- [ ] Content Resource - Video
- [ ] Content Resource - Text
- [ ] Service
- [ ] Provider
- [ ] Other - please list below
<!-- Add other Objects/Classes here -->

## Considerations
<!-- Any extra considerations for the behavior of this helper -->



Discussion / hints:

Fix patch:
diff --git a/iiif_prezi3/helpers/__init__.py b/iiif_prezi3/helpers/__init__.py
index 56b5aa6..9c5d049 100644
--- a/iiif_prezi3/helpers/__init__.py
+++ b/iiif_prezi3/helpers/__init__.py
@@ -6,6 +6,7 @@
 from .auto_fields import *  # noqa: F401,F403
 from .canvas_helpers import AddImageToCanvas  # noqa: F401
 from .canvas_sizes import MaxHelper, MinHelper  # noqa: F401
+from .make_canvas import MakeCanvas  # noqa: F401
 from .make_collection import MakeCollection  # noqa: F401
 from .make_manifest import MakeManifest  # noqa: F401
 from .set_hwd import SetHwd  # noqa: F401
diff --git a/iiif_prezi3/helpers/make_canvas.py b/iiif_prezi3/helpers/make_canvas.py
new file mode 100644
index 0000000..88d6eb6
--- /dev/null
+++ b/iiif_prezi3/helpers/make_canvas.py
@@ -0,0 +1,19 @@
+from ..loader import monkeypatch_schema
+from ..skeleton import Canvas, Manifest
+
+
+class MakeCanvas:
+
+    def make_canvas(self, **kwargs):
+        """Add a Canvas to a Manifest.
+
+        Creates a new Canvas, appends it to the
+        calling Manifest items and returns the newly created Canvas.
+        Accepts keyword arguments to customize the resulting instance.
+        """
+        canvas = Canvas(**kwargs)
+        self.add_item(canvas)
+        return canvas
+
+
+monkeypatch_schema(Manifest, MakeCanvas)


Test patch:
diff --git a/tests/test_make_canvas.py b/tests/test_make_canvas.py
new file mode 100644
index 0000000..fdc3fa4
--- /dev/null
+++ b/tests/test_make_canvas.py
@@ -0,0 +1,17 @@
+import unittest
+
+from iiif_prezi3 import Canvas, Manifest
+
+
+class MakeManifestTest(unittest.TestCase):
+
+    def setUp(self):
+        self.manifest = Manifest(label={'en': ['Manifest label']})
+
+    def test_make_canvas(self):
+        canvas = self.manifest.make_canvas(
+            label={'en': ['Canvas label']})
+        self.assertEqual(len(self.manifest.items), 1)
+        self.assertIsInstance(self.manifest.items[0], Canvas)
+        self.assertEqual(canvas.label,
+                         {'en': ['Canvas label']})