diff options
author | Matthew Lemon <y@yulqen.org> | 2024-05-24 20:43:43 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-05-24 20:43:43 +0100 |
commit | fda2c61fab80cbb8733dcbe32a061785c67b18a4 (patch) | |
tree | 4337a0ff6e0b4e538d92bb8b448720a5590ef91b /pyblackbird_cc/resources/tests/test_models.py | |
parent | 295b84a90f36b437356dc8c22b69dd230e44a823 (diff) |
Tests validation of resource create form
In particular related to the new feature_slot field.
Ensures that the feature_slot integer must be unique when attempts to
save to the database and that the value given in the form is between 1
and 3.
Diffstat (limited to 'pyblackbird_cc/resources/tests/test_models.py')
-rw-r--r-- | pyblackbird_cc/resources/tests/test_models.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pyblackbird_cc/resources/tests/test_models.py b/pyblackbird_cc/resources/tests/test_models.py index 34f2905..ec420ae 100644 --- a/pyblackbird_cc/resources/tests/test_models.py +++ b/pyblackbird_cc/resources/tests/test_models.py @@ -2,10 +2,11 @@ import unittest from unittest.mock import patch import pytest -from django.test import TestCase from django.db import IntegrityError +from django.test import TestCase from pyblackbird_cc.resources.factories import PDFPageSnapshotModelFactory +from pyblackbird_cc.resources.factories import ResourceModelFactory from pyblackbird_cc.resources.models import PDFPageSnapshot from pyblackbird_cc.resources.models import PDFResource from pyblackbird_cc.resources.models import Resource @@ -13,7 +14,6 @@ from pyblackbird_cc.resources.models import ResourceCategory from pyblackbird_cc.resources.models import ResourceType from pyblackbird_cc.resources.views import ResourceInfo from pyblackbird_cc.resources.views import _extract_metadata_from_resource -from pyblackbird_cc.resources.factories import ResourceModelFactory # TODO - convert this test into the test of a function # that takes a Resource object and returns all the PDF snapshots |