diff --git a/app/core/migrations/0024_checktype.py b/app/core/migrations/0024_checktype.py new file mode 100644 index 00000000..12236c8e --- /dev/null +++ b/app/core/migrations/0024_checktype.py @@ -0,0 +1,42 @@ +# Generated by Django 4.2.11 on 2024-08-21 01:34 + +from django.db import migrations, models +import uuid + + +class Migration(migrations.Migration): + + dependencies = [ + ("core", "0023_event_could_attend_event_must_attend_and_more"), + ] + + operations = [ + migrations.CreateModel( + name="CheckType", + fields=[ + ( + "uuid", + models.UUIDField( + default=uuid.uuid4, + editable=False, + primary_key=True, + serialize=False, + unique=True, + ), + ), + ( + "created_at", + models.DateTimeField(auto_now_add=True, verbose_name="Created at"), + ), + ( + "updated_at", + models.DateTimeField(auto_now=True, verbose_name="Updated at"), + ), + ("name", models.CharField(max_length=255)), + ("description", models.TextField(blank=True)), + ], + options={ + "abstract": False, + }, + ), + ] diff --git a/app/core/migrations/max_migration.txt b/app/core/migrations/max_migration.txt index 9848256c..0e1e2cb3 100644 --- a/app/core/migrations/max_migration.txt +++ b/app/core/migrations/max_migration.txt @@ -1 +1 @@ -0023_event_could_attend_event_must_attend_and_more +0024_checktype diff --git a/app/core/models.py b/app/core/models.py index 6cec1b66..77f8c00c 100644 --- a/app/core/models.py +++ b/app/core/models.py @@ -371,3 +371,15 @@ def __str__(self): return f"Partner {self.affiliate}" else: return "Neither a partner or a sponsor" + + +class CheckType(AbstractBaseModel): + """ + Types of checks we perform + """ + + name = models.CharField(max_length=255) + description = models.TextField(blank=True) + + def __str__(self): + return f"{self.name}" diff --git a/app/core/tests/conftest.py b/app/core/tests/conftest.py index a5cc3757..ef942c8a 100644 --- a/app/core/tests/conftest.py +++ b/app/core/tests/conftest.py @@ -3,6 +3,7 @@ from ..models import Affiliate from ..models import Affiliation +from ..models import CheckType from ..models import Event from ..models import Faq from ..models import FaqViewed @@ -196,3 +197,11 @@ def affiliation4(project, affiliate): return Affiliation.objects.create( is_sponsor=False, is_partner=False, project=project, affiliate=affiliate ) + + +@pytest.fixture +def check_type(): + return CheckType.objects.create( + name="This is a test check_type.", + description="This is a test check_type description.", + ) diff --git a/app/core/tests/test_models.py b/app/core/tests/test_models.py index 62a81ab1..0d8e780e 100644 --- a/app/core/tests/test_models.py +++ b/app/core/tests/test_models.py @@ -113,3 +113,8 @@ def test_affiliation_is_neither_partner_and_sponsor(affiliation4): assert xref_instance.is_sponsor is False assert xref_instance.is_partner is False assert str(xref_instance) == "Neither a partner or a sponsor" + + +def test_check_type(check_type): + assert str(check_type) == "This is a test check_type." + assert check_type.description == "This is a test check_type description."