mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-01 03:00:54 +00:00
Cleanup / consolidate unit testing code (#4831)
- Move testing code out of helpers.py - Create new file unit_test.py
This commit is contained in:
@ -16,8 +16,8 @@ from rest_framework import status
|
||||
import company.models
|
||||
import part.models
|
||||
from common.models import InvenTreeSetting
|
||||
from InvenTree.api_tester import InvenTreeAPITestCase
|
||||
from InvenTree.status_codes import StockStatus
|
||||
from InvenTree.unit_test import InvenTreeAPITestCase
|
||||
from part.models import Part
|
||||
from stock.models import StockItem, StockItemTestResult, StockLocation
|
||||
|
||||
|
@ -2,14 +2,14 @@
|
||||
|
||||
from django_test_migrations.contrib.unittest_case import MigratorTestCase
|
||||
|
||||
from InvenTree import helpers
|
||||
from InvenTree import unit_test
|
||||
|
||||
|
||||
class TestSerialNumberMigration(MigratorTestCase):
|
||||
"""Test data migration which updates serial numbers"""
|
||||
|
||||
migrate_from = ('stock', '0067_alter_stockitem_part')
|
||||
migrate_to = ('stock', helpers.getNewestMigrationFile('stock'))
|
||||
migrate_to = ('stock', unit_test.getNewestMigrationFile('stock'))
|
||||
|
||||
def prepare(self):
|
||||
"""Create initial data for this migration"""
|
||||
@ -73,7 +73,7 @@ class TestScheduledForDeletionMigration(MigratorTestCase):
|
||||
"""Test data migration for removing 'scheduled_for_deletion' field"""
|
||||
|
||||
migrate_from = ('stock', '0066_stockitem_scheduled_for_deletion')
|
||||
migrate_to = ('stock', helpers.getNewestMigrationFile('stock'))
|
||||
migrate_to = ('stock', unit_test.getNewestMigrationFile('stock'))
|
||||
|
||||
def prepare(self):
|
||||
"""Create some initial stock items"""
|
||||
|
@ -4,8 +4,8 @@ from django.contrib.auth.models import Group
|
||||
from django.urls import reverse
|
||||
|
||||
from common.models import InvenTreeSetting
|
||||
from InvenTree.helpers import InvenTreeTestCase
|
||||
from InvenTree.status_codes import StockStatus
|
||||
from InvenTree.unit_test import InvenTreeTestCase
|
||||
from stock.models import StockItem, StockLocation
|
||||
from users.models import Owner
|
||||
|
||||
|
@ -9,8 +9,8 @@ from django.test import override_settings
|
||||
from build.models import Build
|
||||
from common.models import InvenTreeSetting
|
||||
from company.models import Company
|
||||
from InvenTree.helpers import InvenTreeTestCase
|
||||
from InvenTree.status_codes import StockHistoryCode
|
||||
from InvenTree.unit_test import InvenTreeTestCase
|
||||
from order.models import SalesOrder
|
||||
from part.models import Part
|
||||
|
||||
|
Reference in New Issue
Block a user