Repository: Shopify/shopify_python_api

Issue:
metafields() method should be able to take options parameters for limit and page
```
import shopify
product = shopify.Product.find(5972485446)
metafields = product.metafields()
print(len(metafields))
> 50
metafields = product.metafields(limit=250)
> TypeError: metafields() got an unexpected keyword argument 'limit'
```
I looked into the code, and it seems like it may be a simple fix. If I come up with something I'll submit a pull request, if I can't I'll let it be known here so somebody else can try tackling it.

Comments:

Patch:
diff --git a/.travis.yml b/.travis.yml
index 8fd1e39..98323d2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,6 +3,7 @@ language: python
 python:
   - "2.7"
   - "3.4"
+  - "3.5"
 
 # command to install dependencies
 install: "python setup.py install"
diff --git a/README.md b/README.md
index 4cc0d41..b2d0d1e 100644
--- a/README.md
+++ b/README.md
@@ -253,6 +253,24 @@ To run tests, simply open up the project directory in a terminal and run:
 python setup.py test
 ```
 
+Alternatively, use [tox](http://tox.readthedocs.org/en/latest/) to
+sequentially test against different versions of Python in isolated
+environments:
+
+```shell
+pip install tox
+tox
+```
+
+See the tox documentation for help on running only specific environments
+at a time. The related tool [detox](https://pypi.python.org/pypi/detox)
+can be used to run tests in these environments in parallel:
+
+```shell
+pip install detox
+detox
+```
+
 ## Limitations
 
 Currently there is no support for:
diff --git a/setup.py b/setup.py
index e4a6daa..1f41bb4 100644
--- a/setup.py
+++ b/setup.py
@@ -39,6 +39,7 @@ setup(name=NAME,
                    'Programming Language :: Python :: 2.7',
                    'Programming Language :: Python :: 3',
                    'Programming Language :: Python :: 3.4',
+                   'Programming Language :: Python :: 3.5',
                    'Topic :: Software Development',
                    'Topic :: Software Development :: Libraries',
                    'Topic :: Software Development :: Libraries :: Python Modules']
diff --git a/shopify/mixins.py b/shopify/mixins.py
index 9d3c179..c7806a0 100644
--- a/shopify/mixins.py
+++ b/shopify/mixins.py
@@ -11,8 +11,15 @@ class Countable(object):
 
 class Metafields(object):
 
-    def metafields(self):
-        return shopify.resources.Metafield.find(resource=self.__class__.plural, resource_id=self.id)
+    def metafields(self, _options=None, **kwargs):
+        if _options is None:
+            _options = kwargs
+        return shopify.resources.Metafield.find(resource=self.__class__.plural, resource_id=self.id, **_options)
+
+    def metafields_count(self, _options=None, **kwargs):
+        if _options is None:
+            _options = kwargs
+        return int(self.get("metafields/count", **_options))
 
     def add_metafield(self, metafield):
         if self.is_new():
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..a2f77bd
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,21 @@
+[tox]
+envlist = py27, py34, py35
+
+[testenv]
+setenv =
+    PYTHONPATH = {toxinidir}:{toxinidir}/shopify
+commands = python setup.py test
+
+[testenv:flake8]
+basepython=python
+deps=
+    flake8
+    flake8_docstrings
+commands=
+    flake8 shopify
+
+[flake8]
+ignore = E126,E128
+max-line-length = 99
+exclude = .ropeproject
+max-complexity = 10


Test patch:
diff --git a/test/fixtures/metafields_count.json b/test/fixtures/metafields_count.json
new file mode 100644
index 0000000..a113c32
--- /dev/null
+++ b/test/fixtures/metafields_count.json
@@ -0,0 +1,1 @@
+{"count":2}
diff --git a/test/product_test.py b/test/product_test.py
index c48962a..dcc9ae7 100644
--- a/test/product_test.py
+++ b/test/product_test.py
@@ -28,6 +28,26 @@ class ProductTest(TestCase):
         for field in metafields:
             self.assertTrue(isinstance(field, shopify.Metafield))
 
+    def test_get_metafields_for_product_with_params(self):
+        self.fake("products/632910392/metafields.json?limit=2", extension=False, body=self.load_fixture('metafields'))
+
+        metafields = self.product.metafields(limit=2)
+        self.assertEqual(2, len(metafields))
+        for field in metafields:
+            self.assertTrue(isinstance(field, shopify.Metafield))
+
+    def test_get_metafields_for_product_count(self):
+        self.fake("products/632910392/metafields/count", body=self.load_fixture('metafields_count'))
+
+        metafields_count = self.product.metafields_count()
+        self.assertEqual(2, metafields_count)
+
+    def test_get_metafields_for_product_count_with_params(self):
+        self.fake("products/632910392/metafields/count.json?value_type=string", extension=False, body=self.load_fixture('metafields_count'))
+
+        metafields_count = self.product.metafields_count(value_type="string")
+        self.assertEqual(2, metafields_count)
+
     def test_update_loaded_variant(self):
         self.fake("products/632910392/variants/808950810", method='PUT', code=200, body=self.load_fixture('variant'))