Update tests for test_raise_error_if_no_suitable_renderers_found

This commit is contained in:
Johnson Liu 2024-11-19 11:34:59 +08:00 committed by GitHub
parent 00e5065fa4
commit ae865773f4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,7 +1,7 @@
import pytest
from django.http import Http404
from django.test import TestCase
from rest_framework.exceptions import NotAcceptable
from rest_framework.negotiation import (
BaseContentNegotiation, DefaultContentNegotiation
)
@ -81,7 +81,7 @@ class TestAcceptedMediaType(TestCase):
class MockRenderer:
format = 'xml'
renderers = [MockRenderer()]
with pytest.raises(Http404):
with pytest.raises(NotAcceptable):
self.negotiator.filter_renderers(renderers, format='json')