mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-13 08:21:26 +00:00
Unit test speed improvements (#4463)
* Unit test speed improvements - Move from insantiating data in setUp to setUpTestData * Update UserMixin class for API testing * Bunch of test updates * Further test updates * Test fixes * Add allowances for exchange rate server not responding * Fixes for group role test
This commit is contained in:
@ -17,11 +17,14 @@ class CompanyTest(InvenTreeAPITestCase):
|
||||
'purchase_order.change',
|
||||
]
|
||||
|
||||
def setUp(self):
|
||||
@classmethod
|
||||
def setUpTestData(cls):
|
||||
"""Perform initialization for the unit test class"""
|
||||
super().setUp()
|
||||
|
||||
self.acme = Company.objects.create(name='ACME', description='Supplier', is_customer=False, is_supplier=True)
|
||||
super().setUpTestData()
|
||||
|
||||
# Create some company objects to work with
|
||||
cls.acme = Company.objects.create(name='ACME', description='Supplier', is_customer=False, is_supplier=True)
|
||||
Company.objects.create(name='Drippy Cup Co.', description='Customer', is_customer=True, is_supplier=False)
|
||||
Company.objects.create(name='Sippy Cup Emporium', description='Another supplier')
|
||||
|
||||
|
Reference in New Issue
Block a user