diff options
author | Matthew Lemon <y@yulqen.org> | 2024-05-16 16:57:14 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-05-16 16:57:14 +0100 |
commit | 55e5dfbd51924f1f23e5a651d830206be01e376c (patch) | |
tree | e3ea881742b3afc2c473c890cbfd8d98d20cc4a9 /pyblackbird_cc/resources/tests/test_models.py | |
parent | 65c49ea41ecd8e1cce07db1b258a93132cb634d4 (diff) |
wip: starting to test feature resource functionality with factories
Diffstat (limited to '')
-rw-r--r-- | pyblackbird_cc/resources/tests/test_models.py | 10 |
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" |