Ai
1 Star 0 Fork 0

Adolph/shopify_python_api

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
report_test.py 1.54 KB
一键复制 编辑 原始数据 按行查看 历史
David Schwartz 提交于 2017-04-22 01:50 +08:00 . Add report API
import shopify
from test.test_helper import TestCase
class CustomerSavedSearchTest(TestCase):
def test_get_report(self):
self.fake('reports/987',
method='GET',
code=200,
body=self.load_fixture('report'))
report = shopify.Report.find(987)
self.assertEqual(987, report.id)
def test_get_reports(self):
self.fake('reports',
method='GET',
code=200,
body=self.load_fixture('reports'))
reports = shopify.Report.find()
self.assertEqual('custom_app_reports', reports[0].category)
def test_create_report(self):
self.fake('reports',
method='POST',
code=201,
body=self.load_fixture('report'),
headers={'Content-type': 'application/json'})
report = shopify.Report.create({
"name": "Custom App Report",
"shopify_ql": "SHOW quantity_count, total_sales BY product_type, vendor, product_title FROM products SINCE -1m UNTIL -0m ORDER BY total_sales DESC"
})
self.assertEqual('custom_app_reports', report.category)
def test_delete_report(self):
self.fake('reports/987',
method='GET',
code=200,
body=self.load_fixture('report'))
self.fake('reports',
method='DELETE',
code=200,
body='[]')
report = shopify.Report.find(987)
self.assertTrue(report.destroy)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/chen_guo_hong/shopify_python_api.git
git@gitee.com:chen_guo_hong/shopify_python_api.git
chen_guo_hong
shopify_python_api
shopify_python_api
master

搜索帮助