Hi everyone!
I’m pretty new here and I am trying to set up Django in my local environment for contributions.
I am following the : Writing your first patch for Django | Django documentation | Django to get myself familiar with on how to get started.
I am stuck on this issue for a while now, where some of the tests are failing without even doing any changes in the code base, I tried to look for solutions but couldn’t find anything helpful.
The error:
FAIL: test_readonly_root (file_uploads.tests.DirectoryCreationTests)
Permission errors are not swallowed
----------------------------------------------------------------------
Traceback (most recent call last):
File "/root/.pyenv/versions/3.10.0/lib/python3.10/unittest/case.py", line 59, in testPartExecutor
yield
File "/root/.pyenv/versions/3.10.0/lib/python3.10/unittest/case.py", line 591, in run
self._callTestMethod(testMethod)
File "/root/.pyenv/versions/3.10.0/lib/python3.10/unittest/case.py", line 549, in _callTestMethod
method()
File "/mnt/c/Users/DELL/Documents/django-dev/django/django/test/utils.py", line 443, in inner
return func(*args, **kwargs)
File "/mnt/c/Users/DELL/Documents/django-dev/django/tests/file_uploads/tests.py", line 820, in test_readonly_root
with self.assertRaises(PermissionError):
File "/root/.pyenv/versions/3.10.0/lib/python3.10/unittest/case.py", line 226, in __exit__
self._raiseFailure("{} not raised".format(exc_name))
File "/root/.pyenv/versions/3.10.0/lib/python3.10/unittest/case.py", line 163, in _raiseFailure
raise self.test_case.failureException(msg)
AssertionError: PermissionError not raised
======================================================================
FAIL: test_honor_umask (admin_scripts.tests.StartProject) [settings.py]
----------------------------------------------------------------------
Traceback (most recent call last):
File "/root/.pyenv/versions/3.10.0/lib/python3.10/unittest/case.py", line 59, in testPartExecutor
yield
File "/root/.pyenv/versions/3.10.0/lib/python3.10/unittest/case.py", line 498, in subTest
yield
File "/mnt/c/Users/DELL/Documents/django-dev/django/tests/admin_scripts/tests.py", line 2828, in test_honor_umask
self.assertEqual(
File "/root/.pyenv/versions/3.10.0/lib/python3.10/unittest/case.py", line 837, in assertEqual
assertion_func(first, second, msg=msg)
File "/root/.pyenv/versions/3.10.0/lib/python3.10/unittest/case.py", line 830, in _baseAssertEqual
raise self.failureException(msg)
AssertionError: 448 != 384
======================================================================
FAIL: test_permissions_error (template_tests.test_loaders.FileSystemLoaderTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/root/.pyenv/versions/3.10.0/lib/python3.10/unittest/case.py", line 59, in testPartExecutor
yield
File "/root/.pyenv/versions/3.10.0/lib/python3.10/unittest/case.py", line 591, in run
self._callTestMethod(testMethod)
File "/root/.pyenv/versions/3.10.0/lib/python3.10/unittest/case.py", line 549, in _callTestMethod
method()
File "/mnt/c/Users/DELL/Documents/django-dev/django/tests/template_tests/test_loaders.py", line 226, in test_permissions_error
with self.assertRaisesMessage(PermissionError, "Permission denied"):
File "/root/.pyenv/versions/3.10.0/lib/python3.10/contextlib.py", line 142, in __exit__
next(self.gen)
File "/mnt/c/Users/DELL/Documents/django-dev/django/django/test/testcases.py", line 739, in _assert_raises_or_warns_cm
with func(expected_exception) as cm:
File "/root/.pyenv/versions/3.10.0/lib/python3.10/unittest/case.py", line 226, in __exit__
self._raiseFailure("{} not raised".format(exc_name))
File "/root/.pyenv/versions/3.10.0/lib/python3.10/unittest/case.py", line 163, in _raiseFailure
raise self.test_case.failureException(msg)
AssertionError: PermissionError not raised
----------------------------------------------------------------------
Ran 16549 tests in 352.284s
FAILED (failures=3, skipped=1330, expected failures=5)
I would like very much to continue and explore Django, but can’t find any answer to this problem.
Can anyone please help me with figuring out what can be the issue behind this and how I can resolve it?
Thank you very much