mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 17:47:04 +03:00
Resolve tests against Django master (#4218)
This commit is contained in:
parent
f81d516ae4
commit
ea92d50582
|
@ -85,6 +85,7 @@ class TestRequestVersion:
|
||||||
response = view(request)
|
response = view(request)
|
||||||
assert response.data == {'version': None}
|
assert response.data == {'version': None}
|
||||||
|
|
||||||
|
@override_settings(ALLOWED_HOSTS=['*'])
|
||||||
def test_host_name_versioning(self):
|
def test_host_name_versioning(self):
|
||||||
scheme = versioning.HostNameVersioning
|
scheme = versioning.HostNameVersioning
|
||||||
view = RequestVersionView.as_view(versioning_class=scheme)
|
view = RequestVersionView.as_view(versioning_class=scheme)
|
||||||
|
@ -173,6 +174,7 @@ class TestURLReversing(URLPatternsTestCase):
|
||||||
response = view(request)
|
response = view(request)
|
||||||
assert response.data == {'url': 'http://testserver/another/'}
|
assert response.data == {'url': 'http://testserver/another/'}
|
||||||
|
|
||||||
|
@override_settings(ALLOWED_HOSTS=['*'])
|
||||||
def test_reverse_host_name_versioning(self):
|
def test_reverse_host_name_versioning(self):
|
||||||
scheme = versioning.HostNameVersioning
|
scheme = versioning.HostNameVersioning
|
||||||
view = ReverseView.as_view(versioning_class=scheme)
|
view = ReverseView.as_view(versioning_class=scheme)
|
||||||
|
@ -223,6 +225,7 @@ class TestInvalidVersion:
|
||||||
response = view(request)
|
response = view(request)
|
||||||
assert response.status_code == status.HTTP_404_NOT_FOUND
|
assert response.status_code == status.HTTP_404_NOT_FOUND
|
||||||
|
|
||||||
|
@override_settings(ALLOWED_HOSTS=['*'])
|
||||||
def test_invalid_host_name_versioning(self):
|
def test_invalid_host_name_versioning(self):
|
||||||
scheme = versioning.HostNameVersioning
|
scheme = versioning.HostNameVersioning
|
||||||
view = RequestInvalidVersionView.as_view(versioning_class=scheme)
|
view = RequestInvalidVersionView.as_view(versioning_class=scheme)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user