mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-16 01:36:29 +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:
@@ -2,14 +2,14 @@
|
||||
|
||||
from django_test_migrations.contrib.unittest_case import MigratorTestCase
|
||||
|
||||
from InvenTree import helpers
|
||||
from InvenTree import unit_test
|
||||
|
||||
|
||||
class TestForwardMigrations(MigratorTestCase):
|
||||
"""Test entire schema migration sequence for the build app."""
|
||||
|
||||
migrate_from = ('build', helpers.getOldestMigrationFile('build'))
|
||||
migrate_to = ('build', helpers.getNewestMigrationFile('build'))
|
||||
migrate_from = ('build', unit_test.getOldestMigrationFile('build'))
|
||||
migrate_to = ('build', unit_test.getNewestMigrationFile('build'))
|
||||
|
||||
def prepare(self):
|
||||
"""Create initial data!"""
|
||||
@@ -58,7 +58,7 @@ class TestForwardMigrations(MigratorTestCase):
|
||||
class TestReferenceMigration(MigratorTestCase):
|
||||
"""Test custom migration which adds 'reference' field to Build model."""
|
||||
|
||||
migrate_from = ('build', helpers.getOldestMigrationFile('build'))
|
||||
migrate_from = ('build', unit_test.getOldestMigrationFile('build'))
|
||||
migrate_to = ('build', '0018_build_reference')
|
||||
|
||||
def prepare(self):
|
||||
@@ -113,7 +113,7 @@ class TestReferencePatternMigration(MigratorTestCase):
|
||||
"""
|
||||
|
||||
migrate_from = ('build', '0019_auto_20201019_1302')
|
||||
migrate_to = ('build', helpers.getNewestMigrationFile('build'))
|
||||
migrate_to = ('build', unit_test.getNewestMigrationFile('build'))
|
||||
|
||||
def prepare(self):
|
||||
"""Create some initial data prior to migration"""
|
||||
|
Reference in New Issue
Block a user