From 089d6a8c7f84e4cd4660983a60b894be299b3abc Mon Sep 17 00:00:00 2001 From: Hironsan Date: Wed, 18 May 2022 08:02:36 +0900 Subject: [PATCH] Add DummyLabelType model for data import --- .../data_import/migrations/0001_initial.py | 25 +++++++++++++++++++ backend/data_import/models.py | 10 ++++++++ 2 files changed, 35 insertions(+) create mode 100644 backend/data_import/migrations/0001_initial.py diff --git a/backend/data_import/migrations/0001_initial.py b/backend/data_import/migrations/0001_initial.py new file mode 100644 index 00000000..f6a55ee3 --- /dev/null +++ b/backend/data_import/migrations/0001_initial.py @@ -0,0 +1,25 @@ +# Generated by Django 4.0.2 on 2022-05-17 23:01 + +from django.db import migrations + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ("label_types", "0007_delete_relationtypeold"), + ] + + operations = [ + migrations.CreateModel( + name="DummyLabelType", + fields=[], + options={ + "proxy": True, + "indexes": [], + "constraints": [], + }, + bases=("label_types.categorytype",), + ), + ] diff --git a/backend/data_import/models.py b/backend/data_import/models.py index e69de29b..30492d5e 100644 --- a/backend/data_import/models.py +++ b/backend/data_import/models.py @@ -0,0 +1,10 @@ +from unittest.mock import MagicMock + +from label_types.models import CategoryType + + +class DummyLabelType(CategoryType): + objects = MagicMock() + + class Meta: + proxy = True