mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
added test for sell price breaks
This commit is contained in:
parent
74c4c559e4
commit
3fb95bea7e
17
InvenTree/part/fixtures/part_pricebreaks.yaml
Normal file
17
InvenTree/part/fixtures/part_pricebreaks.yaml
Normal file
@ -0,0 +1,17 @@
|
||||
# Sell price breaks for parts
|
||||
|
||||
# Price breaks for R_2K2_0805
|
||||
|
||||
- model: part.partsellpricebreak
|
||||
pk: 1
|
||||
fields:
|
||||
part: 3
|
||||
quantity: 1
|
||||
price: 0.15
|
||||
|
||||
- model: part.partsellpricebreak
|
||||
pk: 2
|
||||
fields:
|
||||
part: 3
|
||||
quantity: 10
|
||||
price: 0.10
|
@ -51,6 +51,7 @@ class PartTest(TestCase):
|
||||
'category',
|
||||
'part',
|
||||
'location',
|
||||
'part_pricebreaks'
|
||||
]
|
||||
|
||||
def setUp(self):
|
||||
@ -113,6 +114,13 @@ class PartTest(TestCase):
|
||||
|
||||
self.assertTrue(len(matches) > 0)
|
||||
|
||||
def test_sell_pricing(self):
|
||||
# check that the sell pricebreaks were loaded
|
||||
self.assertTrue(self.r1.has_price_breaks)
|
||||
self.assertEqual(self.r1.price_breaks.count(), 2)
|
||||
# check that the sell pricebreaks work
|
||||
self.assertEqual(float(self.r1.get_price(1)), 0.15)
|
||||
self.assertEqual(float(self.r1.get_price(10)), 1.0)
|
||||
|
||||
class TestTemplateTest(TestCase):
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user