feat: add basic "create order" feature, docs, tests
just the package API docs so far, narrative will come later
This commit is contained in:
parent
89265f0240
commit
ef07d30a85
86 changed files with 7749 additions and 35 deletions
0
tests/db/__init__.py
Normal file
0
tests/db/__init__.py
Normal file
0
tests/db/model/__init__.py
Normal file
0
tests/db/model/__init__.py
Normal file
0
tests/db/model/batch/__init__.py
Normal file
0
tests/db/model/batch/__init__.py
Normal file
23
tests/db/model/batch/test_neworder.py
Normal file
23
tests/db/model/batch/test_neworder.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
# -*- coding: utf-8; -*-
|
||||
|
||||
from wuttjamaican.testing import DataTestCase
|
||||
|
||||
from sideshow.db.model.batch import neworder as mod
|
||||
from sideshow.db.model.products import PendingProduct
|
||||
|
||||
|
||||
class TestNewOrderBatchRow(DataTestCase):
|
||||
|
||||
def test_str(self):
|
||||
|
||||
row = mod.NewOrderBatchRow()
|
||||
self.assertEqual(str(row), "")
|
||||
|
||||
row = mod.NewOrderBatchRow(product_description="Vinegar")
|
||||
self.assertEqual(str(row), "Vinegar")
|
||||
|
||||
product = PendingProduct(brand_name="Bragg",
|
||||
description="Vinegar",
|
||||
size="32oz")
|
||||
row = mod.NewOrderBatchRow(pending_product=product)
|
||||
self.assertEqual(str(row), "Bragg Vinegar 32oz")
|
15
tests/db/model/test_customers.py
Normal file
15
tests/db/model/test_customers.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
# -*- coding: utf-8; -*-
|
||||
|
||||
from wuttjamaican.testing import DataTestCase
|
||||
|
||||
from sideshow.db.model import customers as mod
|
||||
|
||||
|
||||
class TestPendingCustomer(DataTestCase):
|
||||
|
||||
def test_str(self):
|
||||
customer = mod.PendingCustomer()
|
||||
self.assertEqual(str(customer), "")
|
||||
|
||||
customer.full_name = "Fred Flintstone"
|
||||
self.assertEqual(str(customer), "Fred Flintstone")
|
34
tests/db/model/test_orders.py
Normal file
34
tests/db/model/test_orders.py
Normal file
|
@ -0,0 +1,34 @@
|
|||
# -*- coding: utf-8; -*-
|
||||
|
||||
from wuttjamaican.testing import DataTestCase
|
||||
|
||||
from sideshow.db.model import orders as mod
|
||||
from sideshow.db.model.products import PendingProduct
|
||||
|
||||
|
||||
class TestOrder(DataTestCase):
|
||||
|
||||
def test_str(self):
|
||||
|
||||
order = mod.Order()
|
||||
self.assertEqual(str(order), "None")
|
||||
|
||||
order = mod.Order(order_id=42)
|
||||
self.assertEqual(str(order), "42")
|
||||
|
||||
|
||||
class TestOrderItem(DataTestCase):
|
||||
|
||||
def test_str(self):
|
||||
|
||||
item = mod.OrderItem()
|
||||
self.assertEqual(str(item), "")
|
||||
|
||||
item = mod.OrderItem(product_description="Vinegar")
|
||||
self.assertEqual(str(item), "Vinegar")
|
||||
|
||||
product = PendingProduct(brand_name="Bragg",
|
||||
description="Vinegar",
|
||||
size="32oz")
|
||||
item = mod.OrderItem(pending_product=product)
|
||||
self.assertEqual(str(item), "Bragg Vinegar 32oz")
|
44
tests/db/model/test_products.py
Normal file
44
tests/db/model/test_products.py
Normal file
|
@ -0,0 +1,44 @@
|
|||
# -*- coding: utf-8; -*-
|
||||
|
||||
from wuttjamaican.testing import DataTestCase
|
||||
|
||||
from sideshow.db.model import products as mod
|
||||
|
||||
|
||||
class TestPendingProduct(DataTestCase):
|
||||
|
||||
def test_str(self):
|
||||
product = mod.PendingProduct()
|
||||
self.assertEqual(str(product), "")
|
||||
|
||||
product = mod.PendingProduct(brand_name="Bragg")
|
||||
self.assertEqual(str(product), "Bragg")
|
||||
|
||||
product = mod.PendingProduct(description="Vinegar")
|
||||
self.assertEqual(str(product), "Vinegar")
|
||||
|
||||
product = mod.PendingProduct(size="32oz")
|
||||
self.assertEqual(str(product), "32oz")
|
||||
|
||||
product = mod.PendingProduct(brand_name="Bragg",
|
||||
description="Vinegar",
|
||||
size="32oz")
|
||||
self.assertEqual(str(product), "Bragg Vinegar 32oz")
|
||||
|
||||
def test_full_description(self):
|
||||
product = mod.PendingProduct()
|
||||
self.assertEqual(product.full_description, "")
|
||||
|
||||
product = mod.PendingProduct(brand_name="Bragg")
|
||||
self.assertEqual(product.full_description, "Bragg")
|
||||
|
||||
product = mod.PendingProduct(description="Vinegar")
|
||||
self.assertEqual(product.full_description, "Vinegar")
|
||||
|
||||
product = mod.PendingProduct(size="32oz")
|
||||
self.assertEqual(product.full_description, "32oz")
|
||||
|
||||
product = mod.PendingProduct(brand_name="Bragg",
|
||||
description="Vinegar",
|
||||
size="32oz")
|
||||
self.assertEqual(product.full_description, "Bragg Vinegar 32oz")
|
Loading…
Add table
Add a link
Reference in a new issue