mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-18 21:15:41 +00:00
Update test fixtures
- Can't assume that pk values will be assigned sensibly! - Need to hard-code them in
This commit is contained in:
@ -3,18 +3,21 @@
|
||||
# Price breaks for ACME0001
|
||||
|
||||
- model: company.supplierpricebreak
|
||||
pk: 1
|
||||
fields:
|
||||
part: 1
|
||||
quantity: 1
|
||||
cost: 10
|
||||
|
||||
- model: company.supplierpricebreak
|
||||
pk: 2
|
||||
fields:
|
||||
part: 1
|
||||
quantity: 5
|
||||
cost: 7.50
|
||||
|
||||
- model: company.supplierpricebreak
|
||||
pk: 3
|
||||
fields:
|
||||
part: 1
|
||||
quantity: 25
|
||||
@ -22,12 +25,14 @@
|
||||
|
||||
# Price breaks for ACME0002
|
||||
- model: company.supplierpricebreak
|
||||
pk: 4
|
||||
fields:
|
||||
part: 2
|
||||
quantity: 5
|
||||
cost: 7.00
|
||||
|
||||
- model: company.supplierpricebreak
|
||||
pk: 5
|
||||
fields:
|
||||
part: 2
|
||||
quantity: 50
|
||||
@ -35,12 +40,14 @@
|
||||
|
||||
# Price breaks for ZERGLPHS
|
||||
- model: company.supplierpricebreak
|
||||
pk: 6
|
||||
fields:
|
||||
part: 4
|
||||
quantity: 25
|
||||
cost: 8
|
||||
|
||||
- model: company.supplierpricebreak
|
||||
pk: 7
|
||||
fields:
|
||||
part: 4
|
||||
quantity: 100
|
||||
|
@ -113,17 +113,17 @@ class ContactSimpleTest(TestCase):
|
||||
|
||||
def setUp(self):
|
||||
# Create a simple company
|
||||
c = Company.objects.create(name='Test Corp.', description='We make stuff good')
|
||||
self.c = Company.objects.create(name='Test Corp.', description='We make stuff good')
|
||||
|
||||
# Add some contacts
|
||||
Contact.objects.create(name='Joe Smith', company=c)
|
||||
Contact.objects.create(name='Fred Smith', company=c)
|
||||
Contact.objects.create(name='Sally Smith', company=c)
|
||||
Contact.objects.create(name='Joe Smith', company=self.c)
|
||||
Contact.objects.create(name='Fred Smith', company=self.c)
|
||||
Contact.objects.create(name='Sally Smith', company=self.c)
|
||||
|
||||
def test_exists(self):
|
||||
self.assertEqual(Contact.objects.count(), 3)
|
||||
|
||||
def test_delete(self):
|
||||
# Remove the parent company
|
||||
Company.objects.get(pk=1).delete()
|
||||
Company.objects.get(pk=self.c.pk).delete()
|
||||
self.assertEqual(Contact.objects.count(), 0)
|
||||
|
Reference in New Issue
Block a user