aboutsummaryrefslogtreecommitdiffstats
path: root/pyblackbird_cc/resources/tests/test_models.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyblackbird_cc/resources/tests/test_models.py')
-rw-r--r--pyblackbird_cc/resources/tests/test_models.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/pyblackbird_cc/resources/tests/test_models.py b/pyblackbird_cc/resources/tests/test_models.py
index e1fe290..c54120c 100644
--- a/pyblackbird_cc/resources/tests/test_models.py
+++ b/pyblackbird_cc/resources/tests/test_models.py
@@ -1,6 +1,7 @@
import unittest
from unittest.mock import patch
+import pytest
from django.test import TestCase
from pyblackbird_cc.resources.models import PDFPageSnapshot
@@ -12,10 +13,15 @@ from pyblackbird_cc.resources.views import ResourceInfo
from pyblackbird_cc.resources.views import _extract_metadata_from_resource
+@pytest.mark.django_db
+def test_resource_model(resources):
+ assert Resource.objects.filter(name="Default Resource 1").exists()
+
+
class ResourceModelTest(TestCase):
def test_string_representation(self):
resource = Resource(name="Test Resource")
- assert str(resource) == "Test Resource"
+ assert str(resource) == "Test Resource"
@unittest.skip("Skipping this test for now as it is broken")
@@ -39,7 +45,7 @@ class TestExtractMetadata(TestCase):
result = _extract_metadata_from_resource(mock_resource)
self.assertIsInstance(result, ResourceInfo)
assert result.name == "Test Resource"
- assert result.pdf_filenames == "test.pdf"
+ assert result.pdf_filenames == "test.pdf"
assert result.thumbnail_filenames in ["thumb.jpg", "thumb2.jpg"]
assert result.created == "2022-01-01"
assert result.updated == "2022-01-02"