diff options
Diffstat (limited to 'pyblackbird_cc/resources/tests')
-rw-r--r-- | pyblackbird_cc/resources/tests/conftest.py | 5 | ||||
-rw-r--r-- | pyblackbird_cc/resources/tests/test_views.py | 8 |
2 files changed, 13 insertions, 0 deletions
diff --git a/pyblackbird_cc/resources/tests/conftest.py b/pyblackbird_cc/resources/tests/conftest.py index 0d1ed87..9b401ba 100644 --- a/pyblackbird_cc/resources/tests/conftest.py +++ b/pyblackbird_cc/resources/tests/conftest.py @@ -6,3 +6,8 @@ from pyblackbird_cc.resources.factories import ResourceModelFactory @pytest.fixture() def resources(): return ResourceModelFactory.create_batch(5) + + +@pytest.fixture() +def resource(): + return ResourceModelFactory() diff --git a/pyblackbird_cc/resources/tests/test_views.py b/pyblackbird_cc/resources/tests/test_views.py index e71b3a2..b961d3a 100644 --- a/pyblackbird_cc/resources/tests/test_views.py +++ b/pyblackbird_cc/resources/tests/test_views.py @@ -1,5 +1,6 @@ import unittest +import pytest from django.contrib.auth import get_user_model from django.contrib.auth.models import User from django.core.files.uploadedfile import SimpleUploadedFile @@ -13,6 +14,13 @@ from ..models import ResourceType from ..views import create_resource +@pytest.mark.django_db() +def test_create_featured_resource_view(resource, client): + url = reverse("resources:create_featured") + response = client.get(url) + assert response.status_code == 302 + + class PDFFileUploadTestCase(TestCase): def setUp(self): self.url = reverse("resources:create_resource") |