Prevent test giving false-negative if settings.py moved
This commit is contained in:
parent
62823a9493
commit
cba71044a2
1 changed files with 2 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
from django.http import Http404
|
from django.http import Http404
|
||||||
import pytest
|
import pytest
|
||||||
from pytest_django.asserts import assertContains, assertTemplateUsed
|
from pytest_django.asserts import assertContains, assertTemplateUsed
|
||||||
|
@ -35,6 +36,7 @@ def test_annual_report_file_served(rf):
|
||||||
|
|
||||||
|
|
||||||
def test_path_traversal_404s(rf):
|
def test_path_traversal_404s(rf):
|
||||||
|
assert (settings.BASE_DIR / 'static' / 'about/../../settings.py').exists()
|
||||||
request = rf.get('/about/../../settings.py')
|
request = rf.get('/about/../../settings.py')
|
||||||
with pytest.raises(Http404):
|
with pytest.raises(Http404):
|
||||||
views.index(request)
|
views.index(request)
|
||||||
|
|
Loading…
Reference in a new issue