Unit test fixes

(cherry picked from commit 787064abc0)
This commit is contained in:
Oliver Walters 2021-07-19 00:21:02 +10:00
parent 0288a1acbf
commit 0d660e3c69

View File

@ -192,18 +192,14 @@ class ManufacturerPartSimpleTest(TestCase):
SKU='SKU_TEST', SKU='SKU_TEST',
) )
kwargs = { supplier_part.save()
'manufacturer': manufacturer.id,
'MPN': 'MPN_TEST',
}
supplier_part.save(**kwargs)
def test_exists(self): def test_exists(self):
self.assertEqual(ManufacturerPart.objects.count(), 5) self.assertEqual(ManufacturerPart.objects.count(), 4)
# Check that manufacturer part was created from supplier part creation # Check that manufacturer part was created from supplier part creation
manufacturer_parts = ManufacturerPart.objects.filter(manufacturer=1) manufacturer_parts = ManufacturerPart.objects.filter(manufacturer=1)
self.assertEqual(manufacturer_parts.count(), 2) self.assertEqual(manufacturer_parts.count(), 1)
def test_delete(self): def test_delete(self):
# Remove a part # Remove a part