@@ -0,0 +1,1496 @@
+%22%22%22%0AUnit tests for the part model database migrations%0A%22%22%22%0A%0Afrom django_test_migrations.contrib.unittest_case import MigratorTestCase%0A%0Afrom InvenTree import helpers%0A%0A%0Aclass TestForwardMigrations(MigratorTestCase):%0A    %22%22%22%0A    Test entire schema migration sequence for the part app%0A    %22%22%22%0A%0A    migrate_from = ('part', helpers.getOldestMigrationFile('part'))%0A    migrate_to = ('part', helpers.getNewestMigrationFile('part'))%0A%0A    def prepare(self):%0A        %22%22%22%0A        Create initial data%0A        %22%22%22%0A%0A        Part = self.old_state.apps.get_model('part', 'part')%0A%0A        Part.objects.create(name='A', description='My part A')%0A        Part.objects.create(name='B', description='My part B')%0A        Part.objects.create(name='C', description='My part C')%0A        Part.objects.create(name='D', description='My part D')%0A        Part.objects.create(name='E', description='My part E')%0A%0A        # Extract one part object to investigate%0A        p = Part.objects.all().last()%0A%0A        # Initially some fields are not present%0A        with self.assertRaises(AttributeError):%0A            print(p.has_variants)%0A        %0A        with self.assertRaises(AttributeError):%0A            print(p.is_template)%0A%0A%0A    def test_models_exist(self):%0A%0A        Part = self.new_state.apps.get_model('part', 'part')%0A%0A        self.assertEqual(Part.objects.count(), 5)%0A%0A        for part in Part.objects.all():%0A            part.is_template = True%0A            part.save()%0A            part.is_template = False%0A            part.save()%0A

Add initial migration unit test for the 'part' app