2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 21:15:41 +00:00

Add some unit testing

This commit is contained in:
Oliver Walters
2020-10-04 00:24:48 +10:00
parent 6bc5fe2497
commit 2039100d3e
5 changed files with 67 additions and 12 deletions

View File

@ -38,4 +38,5 @@ class CompanyConfig(AppConfig):
company.image = None
company.save()
except (OperationalError, ProgrammingError):
print("Could not generate Company thumbnails")
# Getting here probably meant the database was in test mode
pass

View File

@ -24,7 +24,6 @@ def reverse_association(apps, schema_editor):
# Exit if there are no SupplierPart objects
# This crucial otherwise the unit test suite fails!
if SupplierPart.objects.count() == 0:
print("No SupplierPart objects - skipping")
return
print("Reversing migration for manufacturer association")
@ -105,7 +104,6 @@ def associate_manufacturers(apps, schema_editor):
# Exit if there are no SupplierPart objects
# This crucial otherwise the unit test suite fails!
if SupplierPart.objects.count() == 0:
print("No SupplierPart objects - skipping")
return
# Link a 'manufacturer_name' to a 'Company'