Repository: wolflu05/inventree-bulk-plugin (language: python)

Issue:
Consistent naming of plugin
> [...] I would suggest to rename it to match your repository name so nobody can miss it :smiley:

_Originally posted by @eeintech in https://github.com/inventree/InvenTree/discussions/4084#discussioncomment-4470781_
    


Discussion / hints:
@matmair are there any naming conventions of plugin names, repository name, sub folder, plugin slug, plugin name, plugin title, ...? What would you recommend me to name it?
@wolflu05 tbh: no. Plugins are classes so the plugin class should use camel case per pep 8. I name the main module the same as the class but that is not up to pep 8.

I should probably write a bit more about writing plugins, conventions etc. are there any other questions/things that are non obvious?
@matmair I am struggling if 
1. my slug should be: inventree-bulk-plugin or inventree_bulk_plugin
2. if NAME and TITLE can contain spaces
3. if my plugin should be named with the inventree prefix as like the built in plugins are named. (Btw. Inventree or InvenTree?) so Inventree bulk plugin.
4. my sub folder (currently called inventree_bulk) cannot contain - as this is no valid import path?
1. inventree-bulk-plugin
2. No and yes (both can but it would be better if name did not)
3. If you refer to the project or org it should be InvenTree (mostly for word mark recognition as it could be read as a misspelling of Inventory)
4. folders should generally be named with underscores

@matmair There are even inconsistencies in the built in plugins naming.
1. They contain spaces as NAME
2. One is called InvenTree and one Inventree.
3. Some plugins are named starting with InvenTree, others not
![image](https://user-images.githubusercontent.com/76838159/213725783-c8cd4933-55bb-4696-9aaf-29ff5cd9fe67.png)

Viele Köche und so
> [translation](https://de.wiktionary.org/wiki/viele_K%C3%B6che_verderben_den_Brei)

I'll fix that in a bit. Plugins are currently very much driven by the integration needs/wishes of Oliver and me, with growing usage by the userbase I think we will find more of those oddities and need to fix/clarify them.

Fix patch:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index c527cc5..6957fc9 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -50,7 +50,7 @@ jobs:
 
       - name: Run tests
         run: |
-          python -m coverage run -m unittest discover -s inventree_bulk.tests.unit
+          python -m coverage run -m unittest discover -s inventree_bulk_plugin.tests.unit
           echo $GITHUB_WORKSPACE > coverage_info
 
       - name: Upload coverage
@@ -99,7 +99,7 @@ jobs:
           cd /home/inventree
           pip3 install --no-cache-dir --disable-pip-version-check -U -r requirements.txt
 
-      - name: Setup inventree_bulk_plugin
+      - name: Setup inventree-bulk-plugin
         run: |
           cd /home/inventree
           pip3 install -e $GITHUB_WORKSPACE
@@ -111,7 +111,7 @@ jobs:
       - name: Run tests
         run: |
           cd /home/inventree
-          coverage run --omit="InvenTree/**" InvenTree/manage.py test inventree_bulk.tests.integration
+          coverage run --omit="InvenTree/**" InvenTree/manage.py test inventree_bulk_plugin.tests.integration
           echo $GITHUB_WORKSPACE > coverage_info
 
       - name: Upload coverage
diff --git a/.gitignore b/.gitignore
index b6e4761..a556186 100644
--- a/.gitignore
+++ b/.gitignore
@@ -127,3 +127,5 @@ dmypy.json
 
 # Pyre type checker
 .pyre/
+
+inventree_bulk_plugin/test.py
diff --git a/inventree_bulk/BulkGenerator/BulkGenerator.py b/inventree_bulk_plugin/BulkGenerator/BulkGenerator.py
similarity index 100%
rename from inventree_bulk/BulkGenerator/BulkGenerator.py
rename to inventree_bulk_plugin/BulkGenerator/BulkGenerator.py
diff --git a/inventree_bulk/BulkGenerator/__init__.py b/inventree_bulk_plugin/BulkGenerator/__init__.py
similarity index 100%
rename from inventree_bulk/BulkGenerator/__init__.py
rename to inventree_bulk_plugin/BulkGenerator/__init__.py
diff --git a/inventree_bulk/BulkGenerator/dimensions.py b/inventree_bulk_plugin/BulkGenerator/dimensions.py
similarity index 100%
rename from inventree_bulk/BulkGenerator/dimensions.py
rename to inventree_bulk_plugin/BulkGenerator/dimensions.py
diff --git a/inventree_bulk/BulkGenerator/generators/__init__.py b/inventree_bulk_plugin/BulkGenerator/generators/__init__.py
similarity index 100%
rename from inventree_bulk/BulkGenerator/generators/__init__.py
rename to inventree_bulk_plugin/BulkGenerator/generators/__init__.py
diff --git a/inventree_bulk/BulkGenerator/generators/gen_alpha.py b/inventree_bulk_plugin/BulkGenerator/generators/gen_alpha.py
similarity index 100%
rename from inventree_bulk/BulkGenerator/generators/gen_alpha.py
rename to inventree_bulk_plugin/BulkGenerator/generators/gen_alpha.py
diff --git a/inventree_bulk/BulkGenerator/generators/gen_numeric.py b/inventree_bulk_plugin/BulkGenerator/generators/gen_numeric.py
similarity index 100%
rename from inventree_bulk/BulkGenerator/generators/gen_numeric.py
rename to inventree_bulk_plugin/BulkGenerator/generators/gen_numeric.py
diff --git a/inventree_bulk/BulkGenerator/generators/generator.py b/inventree_bulk_plugin/BulkGenerator/generators/generator.py
similarity index 100%
rename from inventree_bulk/BulkGenerator/generators/generator.py
rename to inventree_bulk_plugin/BulkGenerator/generators/generator.py
diff --git a/inventree_bulk/BulkGenerator/validations.py b/inventree_bulk_plugin/BulkGenerator/validations.py
similarity index 100%
rename from inventree_bulk/BulkGenerator/validations.py
rename to inventree_bulk_plugin/BulkGenerator/validations.py
diff --git a/inventree_bulk/BulkActionPlugin.py b/inventree_bulk_plugin/InvenTreeBulkPlugin.py
similarity index 96%
rename from inventree_bulk/BulkActionPlugin.py
rename to inventree_bulk_plugin/InvenTreeBulkPlugin.py
index de56ec6..2e7ad87 100644
--- a/inventree_bulk/BulkActionPlugin.py
+++ b/inventree_bulk_plugin/InvenTreeBulkPlugin.py
@@ -23,15 +23,15 @@
     BulkCreationTemplate, fields=("name", "template_type", "template"))
 
 
-class BulkActionPlugin(AppMixin, PanelMixin, UrlsMixin, InvenTreePlugin):
+class InvenTreeBulkPlugin(AppMixin, PanelMixin, UrlsMixin, InvenTreePlugin):
     AUTHOR = "wolflu05"
-    DESCRIPTION = "Bulk action plugin"
+    DESCRIPTION = "InvenTree Bulk plugin"
     VERSION = BULK_PLUGIN_VERSION
     MIN_VERSION = "0.9.1"  # due to "invoke update" doesn't run collectstatic (see inventree/InvenTree#4077)
 
-    TITLE = "Bulk Action"
-    SLUG = "bulkaction"
-    NAME = "Bulk Action"
+    TITLE = "InvenTree Bulk Plugin"
+    SLUG = "inventree-bulk-plugin"
+    NAME = "InvenTreeBulkPlugin"
 
     def get_custom_panels(self, view, request):
         panels = []
diff --git a/inventree_bulk/__init__.py b/inventree_bulk_plugin/__init__.py
similarity index 100%
rename from inventree_bulk/__init__.py
rename to inventree_bulk_plugin/__init__.py
diff --git a/inventree_bulk/migrations/0001_initial.py b/inventree_bulk_plugin/migrations/0001_initial.py
similarity index 100%
rename from inventree_bulk/migrations/0001_initial.py
rename to inventree_bulk_plugin/migrations/0001_initial.py
diff --git a/inventree_bulk/migrations/__init__.py b/inventree_bulk_plugin/migrations/__init__.py
similarity index 100%
rename from inventree_bulk/migrations/__init__.py
rename to inventree_bulk_plugin/migrations/__init__.py
diff --git a/inventree_bulk/models.py b/inventree_bulk_plugin/models.py
similarity index 95%
rename from inventree_bulk/models.py
rename to inventree_bulk_plugin/models.py
index 7778a8f..ffefc7b 100644
--- a/inventree_bulk/models.py
+++ b/inventree_bulk_plugin/models.py
@@ -22,7 +22,7 @@ class BulkCreationTemplate(models.Model):
     """Store bulk creation templates."""
 
     class Meta:
-        app_label = "inventree_bulk"
+        app_label = "inventree_bulk_plugin"
 
     name = models.CharField(max_length=250)
     template_type = models.CharField(max_length=100)
diff --git a/inventree_bulk/static/inventree-bulk/htm.LICENSE b/inventree_bulk_plugin/static/inventree-bulk/htm.LICENSE
similarity index 100%
rename from inventree_bulk/static/inventree-bulk/htm.LICENSE
rename to inventree_bulk_plugin/static/inventree-bulk/htm.LICENSE
diff --git a/inventree_bulk/static/inventree-bulk/htm.js b/inventree_bulk_plugin/static/inventree-bulk/htm.js
similarity index 100%
rename from inventree_bulk/static/inventree-bulk/htm.js
rename to inventree_bulk_plugin/static/inventree-bulk/htm.js
diff --git a/inventree_bulk/static/inventree-bulk/preact.LICENSE b/inventree_bulk_plugin/static/inventree-bulk/preact.LICENSE
similarity index 100%
rename from inventree_bulk/static/inventree-bulk/preact.LICENSE
rename to inventree_bulk_plugin/static/inventree-bulk/preact.LICENSE
diff --git a/inventree_bulk/static/inventree-bulk/preact.js b/inventree_bulk_plugin/static/inventree-bulk/preact.js
similarity index 100%
rename from inventree_bulk/static/inventree-bulk/preact.js
rename to inventree_bulk_plugin/static/inventree-bulk/preact.js
diff --git a/inventree_bulk/templates/components/BulkDefinitionSchemaBuilder.js b/inventree_bulk_plugin/templates/components/BulkDefinitionSchemaBuilder.js
similarity index 100%
rename from inventree_bulk/templates/components/BulkDefinitionSchemaBuilder.js
rename to inventree_bulk_plugin/templates/components/BulkDefinitionSchemaBuilder.js
diff --git a/inventree_bulk/templates/components/constants.js b/inventree_bulk_plugin/templates/components/constants.js
similarity index 100%
rename from inventree_bulk/templates/components/constants.js
rename to inventree_bulk_plugin/templates/components/constants.js
diff --git a/inventree_bulk/templates/components/generateBulkCreateView.js b/inventree_bulk_plugin/templates/components/generateBulkCreateView.js
similarity index 97%
rename from inventree_bulk/templates/components/generateBulkCreateView.js
rename to inventree_bulk_plugin/templates/components/generateBulkCreateView.js
index 8a8daad..5ef8064 100644
--- a/inventree_bulk/templates/components/generateBulkCreateView.js
+++ b/inventree_bulk_plugin/templates/components/generateBulkCreateView.js
@@ -11,7 +11,7 @@ function generateBulkCreateView({ target, generateKeys, createURL, name, default
     const [btnCreateLoading, setBtnCreateLoading] = useState(false);
 
     const reloadSavedTemplates = useCallback(async () => {
-      const res = await fetch("{% url 'plugin:bulkaction:templates' %}" + `?template_type=${templateType}`);
+      const res = await fetch("{% url 'plugin:inventree-bulk-plugin:templates' %}" + `?template_type=${templateType}`);
       const data = await res.json();
   
       setSavedTemplates(data.map(t => ({
@@ -30,7 +30,7 @@ function generateBulkCreateView({ target, generateKeys, createURL, name, default
       setSuccess("");
       setBtnPreviewLoading(true);
       
-      const res = await fetch("{% url 'plugin:bulkaction:parse' %}", {
+      const res = await fetch("{% url 'plugin:inventree-bulk-plugin:parse' %}", {
         method: "POST",
         body: JSON.stringify(beautifySchema(schema))
       });
diff --git a/inventree_bulk/templates/panels/category-detail/create-bulk.html b/inventree_bulk_plugin/templates/panels/category-detail/create-bulk.html
similarity index 59%
rename from inventree_bulk/templates/panels/category-detail/create-bulk.html
rename to inventree_bulk_plugin/templates/panels/category-detail/create-bulk.html
index e32f9cb..195cd8f 100644
--- a/inventree_bulk/templates/panels/category-detail/create-bulk.html
+++ b/inventree_bulk_plugin/templates/panels/category-detail/create-bulk.html
@@ -1,6 +1,6 @@
 {% load static %}
-<script src="{% static 'inventree-bulk/preact.js' %}"></script>
-<script src="{% static 'inventree-bulk/htm.js' %}"></script>
+<script src="{% static 'inventree-bulk-plugin/preact.js' %}"></script>
+<script src="{% static 'inventree-bulk-plugin/htm.js' %}"></script>
 
 <div id="bulk-create-category-preact-root"></div>
 
diff --git a/inventree_bulk/templates/panels/category-detail/create-bulk.js b/inventree_bulk_plugin/templates/panels/category-detail/create-bulk.js
similarity index 79%
rename from inventree_bulk/templates/panels/category-detail/create-bulk.js
rename to inventree_bulk_plugin/templates/panels/category-detail/create-bulk.js
index 99526f6..8b13406 100644
--- a/inventree_bulk/templates/panels/category-detail/create-bulk.js
+++ b/inventree_bulk_plugin/templates/panels/category-detail/create-bulk.js
@@ -3,7 +3,7 @@
 generateBulkCreateView({
   target: document.getElementById("bulk-create-category-preact-root"),
   generateKeys: generateKeysForTemplateType.PART_CATEGORY,
-  createURL: "{% url 'plugin:bulkaction:bulkcreatecategory' pk=category.id %}",
+  createURL: "{% url 'plugin:inventree-bulk-plugin:bulkcreatecategory' pk=category.id %}",
   name: "categories",
   defaultSchema: null,
   tableSelector: "#bulk-create-category-preview-table",
diff --git a/inventree_bulk/templates/panels/stock-index/manage-bulk.html b/inventree_bulk_plugin/templates/panels/stock-index/manage-bulk.html
similarity index 58%
rename from inventree_bulk/templates/panels/stock-index/manage-bulk.html
rename to inventree_bulk_plugin/templates/panels/stock-index/manage-bulk.html
index bcf7a2b..a9dbdff 100644
--- a/inventree_bulk/templates/panels/stock-index/manage-bulk.html
+++ b/inventree_bulk_plugin/templates/panels/stock-index/manage-bulk.html
@@ -1,6 +1,6 @@
 {% load static %}
-<script src="{% static 'inventree-bulk/preact.js' %}"></script>
-<script src="{% static 'inventree-bulk/htm.js' %}"></script>
+<script src="{% static 'inventree-bulk-plugin/preact.js' %}"></script>
+<script src="{% static 'inventree-bulk-plugin/htm.js' %}"></script>
 
 <div id="bulk-create-manage-preact-root"></div>
 
diff --git a/inventree_bulk/templates/panels/stock-index/manage-bulk.js b/inventree_bulk_plugin/templates/panels/stock-index/manage-bulk.js
similarity index 96%
rename from inventree_bulk/templates/panels/stock-index/manage-bulk.js
rename to inventree_bulk_plugin/templates/panels/stock-index/manage-bulk.js
index bcac73a..1248158 100644
--- a/inventree_bulk/templates/panels/stock-index/manage-bulk.js
+++ b/inventree_bulk_plugin/templates/panels/stock-index/manage-bulk.js
@@ -52,7 +52,7 @@ function EditForm({ template, setTemplate, templateTypeOptions = {}, handleBack
       setError("");
 
       const create = template.id === null;
-      const res = await fetch("{% url 'plugin:bulkaction:templates' %}" + `/${create ? "" : template.id }`, {
+      const res = await fetch("{% url 'plugin:inventree-bulk-plugin:templates' %}" + `/${create ? "" : template.id }`, {
         method: create ? "POST" : "PUT",
         body: JSON.stringify({...template, template: JSON.stringify(template.template)})
       });
@@ -80,7 +80,7 @@ function EditForm({ template, setTemplate, templateTypeOptions = {}, handleBack
     setSuccess("");
     setBtnPreviewLoading(true);
 
-    const res = await fetch("{% url 'plugin:bulkaction:parse' %}", {
+    const res = await fetch("{% url 'plugin:inventree-bulk-plugin:parse' %}", {
       method: "POST",
       body: JSON.stringify(beautifySchema(template.template))
     });
@@ -173,7 +173,7 @@ function App() {
   const [success, setSuccess] = useState("");
 
   const reloadSavedTemplates = useCallback(async () => {
-    const res = await fetch("{% url 'plugin:bulkaction:templates' %}");
+    const res = await fetch("{% url 'plugin:inventree-bulk-plugin:templates' %}");
     const data = await res.json();
 
     setSavedTemplates(data.map(t => ({
@@ -219,7 +219,7 @@ function App() {
     setError("");
     setSuccess("");
 
-    const res = await fetch("{% url 'plugin:bulkaction:templates' %}" + `/${deletingTemplate.id}`, {
+    const res = await fetch("{% url 'plugin:inventree-bulk-plugin:templates' %}" + `/${deletingTemplate.id}`, {
       method: "DELETE"
     });
 
diff --git a/inventree_bulk/templates/panels/stock-location-detail/create-bulk.html b/inventree_bulk_plugin/templates/panels/stock-location-detail/create-bulk.html
similarity index 59%
rename from inventree_bulk/templates/panels/stock-location-detail/create-bulk.html
rename to inventree_bulk_plugin/templates/panels/stock-location-detail/create-bulk.html
index f001dc7..80094d4 100644
--- a/inventree_bulk/templates/panels/stock-location-detail/create-bulk.html
+++ b/inventree_bulk_plugin/templates/panels/stock-location-detail/create-bulk.html
@@ -1,6 +1,6 @@
 {% load static %}
-<script src="{% static 'inventree-bulk/preact.js' %}"></script>
-<script src="{% static 'inventree-bulk/htm.js' %}"></script>
+<script src="{% static 'inventree-bulk-plugin/preact.js' %}"></script>
+<script src="{% static 'inventree-bulk-plugin/htm.js' %}"></script>
 
 <div id="bulk-create-location-preact-root"></div>
 
diff --git a/inventree_bulk/templates/panels/stock-location-detail/create-bulk.js b/inventree_bulk_plugin/templates/panels/stock-location-detail/create-bulk.js
similarity index 79%
rename from inventree_bulk/templates/panels/stock-location-detail/create-bulk.js
rename to inventree_bulk_plugin/templates/panels/stock-location-detail/create-bulk.js
index 802e68b..0a45578 100644
--- a/inventree_bulk/templates/panels/stock-location-detail/create-bulk.js
+++ b/inventree_bulk_plugin/templates/panels/stock-location-detail/create-bulk.js
@@ -3,7 +3,7 @@
 generateBulkCreateView({
   target: document.getElementById("bulk-create-location-preact-root"),
   generateKeys: generateKeysForTemplateType.STOCK_LOCATION,
-  createURL: "{% url 'plugin:bulkaction:bulkcreatelocation' pk=location.id %}",
+  createURL: "{% url 'plugin:inventree-bulk-plugin:bulkcreatelocation' pk=location.id %}",
   name: "locations",
   defaultSchema: null,
   tableSelector: "#bulk-create-location-preview-table",
diff --git a/inventree_bulk/version.py b/inventree_bulk_plugin/version.py
similarity index 100%
rename from inventree_bulk/version.py
rename to inventree_bulk_plugin/version.py
diff --git a/setup.py b/setup.py
index 7a431f2..0bd083e 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@
 
 import setuptools
 
-from inventree_bulk.version import BULK_PLUGIN_VERSION
+from inventree_bulk_plugin.version import BULK_PLUGIN_VERSION
 
 with open('README.md', encoding='utf-8') as f:
     long_description = f.read()
@@ -44,7 +44,7 @@
 
     entry_points={
         "inventree_plugins": [
-            "BulkActionPlugin = inventree_bulk.BulkActionPlugin:BulkActionPlugin"
+            "InvenTreeBulkPlugin = inventree_bulk_plugin.InvenTreeBulkPlugin:InvenTreeBulkPlugin"
         ]
     },
 


Test patch:
diff --git a/inventree_bulk/tests/__init__.py b/inventree_bulk_plugin/tests/__init__.py
similarity index 100%
rename from inventree_bulk/tests/__init__.py
rename to inventree_bulk_plugin/tests/__init__.py
diff --git a/inventree_bulk/tests/integration/__init__.py b/inventree_bulk_plugin/tests/integration/__init__.py
similarity index 100%
rename from inventree_bulk/tests/integration/__init__.py
rename to inventree_bulk_plugin/tests/integration/__init__.py
diff --git a/inventree_bulk/tests/integration/test_BulkActionPlugin.py b/inventree_bulk_plugin/tests/integration/test_InvenTreeBulkPlugin.py
similarity index 94%
rename from inventree_bulk/tests/integration/test_BulkActionPlugin.py
rename to inventree_bulk_plugin/tests/integration/test_InvenTreeBulkPlugin.py
index f57df65..b7e3283 100644
--- a/inventree_bulk/tests/integration/test_BulkActionPlugin.py
+++ b/inventree_bulk_plugin/tests/integration/test_InvenTreeBulkPlugin.py
@@ -13,10 +13,10 @@
 
 from ...models import validate_template, BulkCreationTemplate
 from ...BulkGenerator.BulkGenerator import BulkGenerator
-from ...BulkActionPlugin import BulkActionPlugin
+from ...InvenTreeBulkPlugin import InvenTreeBulkPlugin
 
 
-class BulkActionPluginModelTestCase(TestCase):
+class InvenTreeBulkPluginModelTestCase(TestCase):
     def test_validate_template(self):
         with self.assertRaisesRegex(ValidationError, "validation errors for BulkDefinitionSchema"):
             validate_template("{}")
@@ -38,7 +38,7 @@ def test_validate_template(self):
         self.assertJSONEqual(valid_schema, validate_template(valid_schema))
 
 
-class BulkActionPluginAPITestCase(InvenTreeAPITestCase):
+class InvenTreeBulkPluginAPITestCase(InvenTreeAPITestCase):
     def setUp(self):
         super().setUp()
 
@@ -83,7 +83,7 @@ def setUp(self):
         }
 
     def test_get_custom_panels(self):
-        bulk_plugin: BulkActionPlugin = registry.get_plugin("bulkaction")
+        bulk_plugin: InvenTreeBulkPlugin = registry.get_plugin("inventree-bulk-plugin")
 
         def assert_contains_by_title(title, panels):
             found = None
@@ -104,7 +104,7 @@ def assert_contains_by_title(title, panels):
         assert_contains_by_title("Bulk creation", panels)
 
     def test_url_parse(self):
-        url = reverse("plugin:bulkaction:parse")
+        url = reverse("plugin:inventree-bulk-plugin:parse")
 
         # There should be only one item generated
         data = self.simple_valid_generation_template
@@ -139,7 +139,7 @@ def test_url_bulk_create(self):
         for object_type_name, object_class in objects:
             with self.subTest(object_type_name=object_type_name):
                 def url(pk):
-                    return reverse(f"plugin:bulkaction:bulkcreate{object_type_name}", kwargs={"pk": pk})
+                    return reverse(f"plugin:inventree-bulk-plugin:bulkcreate{object_type_name}", kwargs={"pk": pk})
 
                 # wrong schema should produce an error
                 self.post(url(0), {"no valid data": "should produce error"}, expected_code=400)
@@ -158,7 +158,7 @@ def url(pk):
 
     def test__bulk_create(self):
         items = BulkGenerator(self.complex_valid_generation_template).generate()
-        bulk_plugin: BulkActionPlugin = registry.get_plugin("bulkaction")
+        bulk_plugin: InvenTreeBulkPlugin = registry.get_plugin("inventree-bulk-plugin")
 
         parent = StockLocation.objects.create(name="Parent", description="Parent description", parent=None)
         bulk_plugin._bulk_create(StockLocation, parent, items, ["name", "description"])
@@ -171,9 +171,9 @@ def test__bulk_create(self):
 
     def _template_url(self, pk=None):
         if pk:
-            return reverse("plugin:bulkaction:templatebyid", kwargs={"pk": pk})
+            return reverse("plugin:inventree-bulk-plugin:templatebyid", kwargs={"pk": pk})
         else:
-            return reverse("plugin:bulkaction:templates")
+            return reverse("plugin:inventree-bulk-plugin:templates")
 
     def test_url_template_get(self):
         BulkCreationTemplate.objects.create(name="Complex Stock template", template_type="STOCK_LOCATION",
diff --git a/inventree_bulk/tests/integration/test_migrations.py b/inventree_bulk_plugin/tests/integration/test_migrations.py
similarity index 87%
rename from inventree_bulk/tests/integration/test_migrations.py
rename to inventree_bulk_plugin/tests/integration/test_migrations.py
index 83e90b8..a0f2e39 100644
--- a/inventree_bulk/tests/integration/test_migrations.py
+++ b/inventree_bulk_plugin/tests/integration/test_migrations.py
@@ -19,12 +19,12 @@ def extract_number(path: PosixPath):
 class TestForwardMigrations(MigratorTestCase):
     """Unit testing class for testing 'bulkcreationtemplate' app migrations."""
 
-    migrate_from = ('inventree_bulk', getMigrationFiles(min))
-    migrate_to = ('inventree_bulk', getMigrationFiles(max))
+    migrate_from = ('inventree_bulk_plugin', getMigrationFiles(min))
+    migrate_to = ('inventree_bulk_plugin', getMigrationFiles(max))
 
     def prepare(self):
         """Create some simple Template data, and ensure that it migrates OK."""
-        bulk_creation_template = self.old_state.apps.get_model('inventree_bulk', 'bulkCreationTemplate')
+        bulk_creation_template = self.old_state.apps.get_model('inventree_bulk_plugin', 'bulkCreationTemplate')
 
         simple_valid_generation_template = {
             "version": "0.1.0",
@@ -42,6 +42,6 @@ def prepare(self):
 
     def test_migrations(self):
         """Test the database state after applying all migrations."""
-        bulk_creation_template = self.old_state.apps.get_model('inventree_bulk', 'bulkcreationtemplate')
+        bulk_creation_template = self.old_state.apps.get_model('inventree_bulk_plugin', 'bulkCreationTemplate')
 
         self.assertEqual(1, bulk_creation_template.objects.count())
diff --git a/inventree_bulk/tests/unit/__init__.py b/inventree_bulk_plugin/tests/unit/__init__.py
similarity index 100%
rename from inventree_bulk/tests/unit/__init__.py
rename to inventree_bulk_plugin/tests/unit/__init__.py
diff --git a/inventree_bulk/tests/unit/test_BulkGenerator.py b/inventree_bulk_plugin/tests/unit/test_BulkGenerator.py
similarity index 100%
rename from inventree_bulk/tests/unit/test_BulkGenerator.py
rename to inventree_bulk_plugin/tests/unit/test_BulkGenerator.py
diff --git a/inventree_bulk/tests/unit/test_dimensions.py b/inventree_bulk_plugin/tests/unit/test_dimensions.py
similarity index 100%
rename from inventree_bulk/tests/unit/test_dimensions.py
rename to inventree_bulk_plugin/tests/unit/test_dimensions.py
diff --git a/inventree_bulk/tests/unit/test_generators.py b/inventree_bulk_plugin/tests/unit/test_generators.py
similarity index 100%
rename from inventree_bulk/tests/unit/test_generators.py
rename to inventree_bulk_plugin/tests/unit/test_generators.py