Repository: Shopify/shopify_python_api

Issue:
cursor-based pagination not working (header name case-sensitivity?)
I am trying to implement the new cursor-based pagination, with ShopifyPythonAPI/6.0.1 on Python/2.7.16 and pyactiveresource 2.2.0. I am testing with the API version 2020-10.

`has_next_page()` always returns false for me even when there are more items. Looking at your source code, `PaginatedCollection`'s `__parse_pagination` method looks for `metadata['header']['Link']` yet for some reasons, all header names are in lower-cases on my environment.

```
>>> p = shopify.Product.find(limit=3)
>>> p.has_next_page()
False
>>> p.metadata['pagination']
{}
>>> p.metadata['headers']['link']
'<https://STORE.myshopify.com/admin/api/2020-01/products.json?limit=3&page_info=CURSOR>; rel="next"'
>>> p.metadata['headers']['Link']
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: 'Link'
```

on a side note, it would be nice if we could retrieve page_info value from PaginatedCollection, so I can use it to fetch the next page. This way I don't need to keep the original page object to access the next page. I see `shopify.Product.find(page_info=CURSOR)` works, although i would feel better if it was documented. 

Thanks.

Discussion:

Patch:
diff --git a/shopify/base.py b/shopify/base.py
index 65349e6..d14401e 100644
--- a/shopify/base.py
+++ b/shopify/base.py
@@ -210,5 +210,5 @@ class ShopifyResource(ActiveResource, mixins.Countable):
         """Checks the resulting collection for pagination metadata."""
         collection = super(ShopifyResource, cls).find(id_=id_, from_=from_, **kwargs)
         if isinstance(collection, Collection) and "headers" in collection.metadata:
-            return PaginatedCollection(collection, metadata={"resource_class": cls})
+            return PaginatedCollection(collection, metadata={"resource_class": cls}, **kwargs)
         return collection
diff --git a/shopify/collection.py b/shopify/collection.py
index a604b1a..b254218 100644
--- a/shopify/collection.py
+++ b/shopify/collection.py
@@ -38,14 +38,18 @@ class PaginatedCollection(Collection):
         self._next = None
         self._previous = None
         self._current_iter = None
-        self._no_iter_next = kwargs.pop("no_iter_next", False)
+        self._no_iter_next = kwargs.pop("no_iter_next", True)
 
     def __parse_pagination(self):
-        if "headers" not in self.metadata or "Link" not in self.metadata["headers"]:
+        if "headers" not in self.metadata:
             return {}
-        values = self.metadata["headers"]["Link"].split(", ")
+
+        values = self.metadata["headers"].get("Link", self.metadata["headers"].get("link", None))
+        if values is None:
+            return {}
+
         result = {}
-        for value in values:
+        for value in values.split(", "):
             link, rel = value.split("; ")
             result[rel.split('"')[1]] = link[1:-1]
         return result


Test patch:
diff --git a/test/pagination_test.py b/test/pagination_test.py
index 3ee05ad..6b00bb7 100644
--- a/test/pagination_test.py
+++ b/test/pagination_test.py
@@ -82,8 +82,6 @@ class PaginationTest(TestCase):
         i = iter(c)
         self.assertEqual(next(i).id, 1)
         self.assertEqual(next(i).id, 2)
-        self.assertEqual(next(i).id, 3)
-        self.assertEqual(next(i).id, 4)
         with self.assertRaises(StopIteration):
             next(i)