diff options
Diffstat (limited to 'pyblackbird_cc/resources/tests')
-rw-r--r-- | pyblackbird_cc/resources/tests/test_models.py | 4 | ||||
-rw-r--r-- | pyblackbird_cc/resources/tests/test_views.py | 14 |
2 files changed, 14 insertions, 4 deletions
diff --git a/pyblackbird_cc/resources/tests/test_models.py b/pyblackbird_cc/resources/tests/test_models.py index ec420ae..2e45d39 100644 --- a/pyblackbird_cc/resources/tests/test_models.py +++ b/pyblackbird_cc/resources/tests/test_models.py @@ -15,10 +15,6 @@ from pyblackbird_cc.resources.models import ResourceType from pyblackbird_cc.resources.views import ResourceInfo from pyblackbird_cc.resources.views import _extract_metadata_from_resource -# TODO - convert this test into the test of a function -# that takes a Resource object and returns all the PDF snapshots -# file names - @pytest.mark.django_db() def test_resource_model(resources): diff --git a/pyblackbird_cc/resources/tests/test_views.py b/pyblackbird_cc/resources/tests/test_views.py index 27a6a85..123476f 100644 --- a/pyblackbird_cc/resources/tests/test_views.py +++ b/pyblackbird_cc/resources/tests/test_views.py @@ -11,6 +11,7 @@ from django.urls import reverse from .. import services from ..models import ResourceCategory from ..models import ResourceType +from ..forms import ResourceCreateForm from ..views import create_resource @@ -21,6 +22,19 @@ def test_create_featured_resource_view(client): assert response.status_code == 302 +@pytest.mark.django_db() +def test_create_resource_view(client): + url = reverse("resources:create_resource") + response = client.get(url) + assert response.status_code == 302 + + +def test_create_resource_has_form(client): + url = reverse("resources:create_resource") + response = client.get(url) + assert type(response.context["form"]) == ResourceCreateForm + + class PDFFileUploadTestCase(TestCase): def setUp(self): self.url = reverse("resources:create_resource") |