mirror of
https://github.com/inventree/InvenTree.git
synced 2026-04-06 03:20:56 +00:00
Specify target migration
This commit is contained in:
@@ -44,7 +44,7 @@ def set_currencies(apps, schema_editor):
|
|||||||
valid_codes.add(code)
|
valid_codes.add(code)
|
||||||
|
|
||||||
if len(valid_codes) == 0:
|
if len(valid_codes) == 0:
|
||||||
print(f"No valid currency codes found in configuration file")
|
print(f"No currency codes found in configuration file - skipping migration")
|
||||||
return
|
return
|
||||||
|
|
||||||
value = ','.join(valid_codes)
|
value = ','.join(valid_codes)
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ from django.core.files.base import ContentFile
|
|||||||
|
|
||||||
from django_test_migrations.contrib.unittest_case import MigratorTestCase
|
from django_test_migrations.contrib.unittest_case import MigratorTestCase
|
||||||
|
|
||||||
from InvenTree import unit_test
|
|
||||||
|
|
||||||
|
|
||||||
def get_legacy_models():
|
def get_legacy_models():
|
||||||
"""Return a set of legacy attachment models."""
|
"""Return a set of legacy attachment models."""
|
||||||
@@ -43,7 +41,7 @@ class TestForwardMigrations(MigratorTestCase):
|
|||||||
"""Test entire schema migration sequence for the common app."""
|
"""Test entire schema migration sequence for the common app."""
|
||||||
|
|
||||||
migrate_from = ('common', '0024_notesimage_model_id_notesimage_model_type')
|
migrate_from = ('common', '0024_notesimage_model_id_notesimage_model_type')
|
||||||
migrate_to = ('common', unit_test.getNewestMigrationFile('common'))
|
migrate_to = ('common', '0039_emailthread_emailmessage')
|
||||||
|
|
||||||
def prepare(self):
|
def prepare(self):
|
||||||
"""Create initial data.
|
"""Create initial data.
|
||||||
|
|||||||
@@ -3047,13 +3047,13 @@ class BomItemTest(InvenTreeAPITestCase):
|
|||||||
self.assertAlmostEqual(can_build, 482.9, places=1)
|
self.assertAlmostEqual(can_build, 482.9, places=1)
|
||||||
|
|
||||||
|
|
||||||
class PartAttachmentTest(InvenTreeAPITestCase):
|
class AttachmentTest(InvenTreeAPITestCase):
|
||||||
"""Unit tests for the PartAttachment API endpoint."""
|
"""Unit tests for the Attachment API endpoint."""
|
||||||
|
|
||||||
fixtures = ['category', 'part', 'location']
|
fixtures = ['category', 'part', 'location']
|
||||||
|
|
||||||
def test_add_attachment(self):
|
def test_add_attachment(self):
|
||||||
"""Test that we can create a new PartAttachment via the API."""
|
"""Test that we can create a new Attachment instances via the API."""
|
||||||
url = reverse('api-attachment-list')
|
url = reverse('api-attachment-list')
|
||||||
|
|
||||||
# Upload without permission
|
# Upload without permission
|
||||||
|
|||||||
Reference in New Issue
Block a user