mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2026-01-02 01:47:04 -05:00
feat: Implement initial schema and add various API, service, and management command enhancements across the application.
This commit is contained in:
@@ -43,9 +43,7 @@ class TestParkMediaServiceUploadPhoto(TestCase):
|
||||
|
||||
park = ParkFactory()
|
||||
user = UserFactory()
|
||||
image_file = SimpleUploadedFile(
|
||||
"test.jpg", b"fake image content", content_type="image/jpeg"
|
||||
)
|
||||
image_file = SimpleUploadedFile("test.jpg", b"fake image content", content_type="image/jpeg")
|
||||
|
||||
photo = ParkMediaService.upload_photo(
|
||||
park=park,
|
||||
@@ -70,9 +68,7 @@ class TestParkMediaServiceUploadPhoto(TestCase):
|
||||
|
||||
park = ParkFactory()
|
||||
user = UserFactory()
|
||||
image_file = SimpleUploadedFile(
|
||||
"test.txt", b"not an image", content_type="text/plain"
|
||||
)
|
||||
image_file = SimpleUploadedFile("test.txt", b"not an image", content_type="text/plain")
|
||||
|
||||
with pytest.raises(ValueError) as exc_info:
|
||||
ParkMediaService.upload_photo(
|
||||
|
||||
@@ -104,7 +104,9 @@ class TestRideServiceCreateRide(TestCase):
|
||||
|
||||
def test__create_ride__invalid_park__raises_exception(self):
|
||||
"""Test create_ride raises exception for invalid park."""
|
||||
with pytest.raises(Exception):
|
||||
from apps.parks.models import Park
|
||||
|
||||
with pytest.raises(Park.DoesNotExist):
|
||||
RideService.create_ride(
|
||||
name="Test Ride",
|
||||
park_id=99999, # Non-existent
|
||||
@@ -274,9 +276,7 @@ class TestRideServiceHandleNewEntitySuggestions(TestCase):
|
||||
"""Tests for RideService.handle_new_entity_suggestions."""
|
||||
|
||||
@patch("apps.rides.services.ModerationService.create_edit_submission_with_queue")
|
||||
def test__handle_new_entity_suggestions__new_manufacturer__creates_submission(
|
||||
self, mock_create_submission
|
||||
):
|
||||
def test__handle_new_entity_suggestions__new_manufacturer__creates_submission(self, mock_create_submission):
|
||||
"""Test handle_new_entity_suggestions creates submission for new manufacturer."""
|
||||
mock_submission = Mock()
|
||||
mock_submission.id = 1
|
||||
@@ -302,9 +302,7 @@ class TestRideServiceHandleNewEntitySuggestions(TestCase):
|
||||
mock_create_submission.assert_called_once()
|
||||
|
||||
@patch("apps.rides.services.ModerationService.create_edit_submission_with_queue")
|
||||
def test__handle_new_entity_suggestions__new_designer__creates_submission(
|
||||
self, mock_create_submission
|
||||
):
|
||||
def test__handle_new_entity_suggestions__new_designer__creates_submission(self, mock_create_submission):
|
||||
"""Test handle_new_entity_suggestions creates submission for new designer."""
|
||||
mock_submission = Mock()
|
||||
mock_submission.id = 2
|
||||
@@ -329,9 +327,7 @@ class TestRideServiceHandleNewEntitySuggestions(TestCase):
|
||||
assert 2 in result["designers"]
|
||||
|
||||
@patch("apps.rides.services.ModerationService.create_edit_submission_with_queue")
|
||||
def test__handle_new_entity_suggestions__new_ride_model__creates_submission(
|
||||
self, mock_create_submission
|
||||
):
|
||||
def test__handle_new_entity_suggestions__new_ride_model__creates_submission(self, mock_create_submission):
|
||||
"""Test handle_new_entity_suggestions creates submission for new ride model."""
|
||||
mock_submission = Mock()
|
||||
mock_submission.id = 3
|
||||
|
||||
Reference in New Issue
Block a user