Is it necessary that all running test should be passed for first time in local for contrbutions ?

As i am encountering some error during the running test for my first time
(staticfiles_tests.test_storage.TestCollectionManifestStorage.test_js_source_map) … ok
test_js_source_map_data_uri (staticfiles_tests.test_storage.TestCollectionManifestStorage.test_js_source_map_data_uri) … ok
test_js_source_map_sensitive (staticfiles_tests.test_storage.TestCollectionManifestStorage.test_js_source_map_sensitive) … ok
test_js_source_map_trailing_whitespace (staticfiles_tests.test_storage.TestCollectionManifestStorage.test_js_source_map_trailing_whitespace) … ok
test_loaded_cache (staticfiles_tests.test_storage.TestCollectionManifestStorage.test_loaded_cache) … ok
test_manifest_does_not_exist (staticfiles_tests.test_storage.TestCollectionManifestStorage.test_manifest_does_not_exist) … ok
test_manifest_does_not_ignore_permission_error (staticfiles_tests.test_storage.TestCollectionManifestStorage.test_manifest_does_not_ignore_permission_error) … ok
test_manifest_exists (staticfiles_tests.test_storage.TestCollectionManifestStorage.test_manifest_exists) … ok
test_manifest_hash (staticfiles_tests.test_storage.TestCollectionManifestStorage.test_manifest_hash) … ok
test_manifest_hash_v1 (staticfiles_tests.test_storage.TestCollectionManifestStorage.test_manifest_hash_v1) … ok
test_missing_entry (staticfiles_tests.test_storage.TestCollectionManifestStorage.test_missing_entry) … ok
test_parse_cache (staticfiles_tests.test_storage.TestCollectionManifestStorage.test_parse_cache) … ok
test_path_ignored_completely (staticfiles_tests.test_storage.TestCollectionManifestStorage.test_path_ignored_completely) … ok
test_path_with_fragment (staticfiles_tests.test_storage.TestCollectionManifestStorage.test_path_with_fragment) … ok
test_path_with_querystring (staticfiles_tests.test_storage.TestCollectionManifestStorage.test_path_with_querystring) … ok
test_path_with_querystring_and_fragment (staticfiles_tests.test_storage.TestCollectionManifestStorage.test_path_with_querystring_and_fragment) … ok
test_post_processing (staticfiles_tests.test_storage.TestCollectionManifestStorage.test_post_processing)
post_processing behaves correctly. … ok
test_post_processing_failure (staticfiles_tests.test_storage.TestCollectionManifestStorage.test_post_processing_failure)
post_processing indicates the origin of the error when it fails. … ok
test_post_processing_nonutf8 (staticfiles_tests.test_storage.TestCollectionManifestStorage.test_post_processing_nonutf8) … ok
test_template_tag_absolute (staticfiles_tests.test_storage.TestCollectionManifestStorage.test_template_tag_absolute) … ok
test_template_tag_absolute_root (staticfiles_tests.test_storage.TestCollectionManifestStorage.test_template_tag_absolute_root)
Like test_template_tag_absolute, but for a file in STATIC_ROOT (#26249). … ok
test_template_tag_deep_relative (staticfiles_tests.test_storage.TestCollectionManifestStorage.test_template_tag_deep_relative) … ok
test_template_tag_relative (staticfiles_tests.test_storage.TestCollectionManifestStorage.test_template_tag_relative) … ok
test_template_tag_return (staticfiles_tests.test_storage.TestCollectionManifestStorage.test_template_tag_return) … ok
test_template_tag_simple_content (staticfiles_tests.test_storage.TestCollectionManifestStorage.test_template_tag_simple_content) … ok
test_template_tag_url (staticfiles_tests.test_storage.TestCollectionManifestStorage.test_template_tag_url) … ok
test_data_available_in_class_setup (migration_test_data_persistence.tests.MigrationDataPersistenceClassSetup.test_data_available_in_class_setup) … ok
test_output_normal (test_runner.test_debug_sql.TestDebugSQL.test_output_normal) … ok
test_output_verbose (test_runner.test_debug_sql.TestDebugSQL.test_output_verbose) … ok
test_setupclass_exception (test_runner.test_debug_sql.TestDebugSQL.test_setupclass_exception) … ok

======================================================================
FAIL: test_no_write_access (i18n.test_compilation.PoFileTests.test_no_write_access)

Traceback (most recent call last):
File “C:\Program Files\Python312\Lib\unittest\case.py”, line 58, in testPartExecutor
yield
File “C:\Program Files\Python312\Lib\unittest\case.py”, line 634, in run
self._callTestMethod(testMethod)
^^^^^^^^^^^^^^^^^
File “C:\Program Files\Python312\Lib\unittest\case.py”, line 589, in _callTestMethod
if method() is not None:
^^^^^^^^^^^^^^^^^
File “C:\Users\rajhi\django\tests\i18n\test_compilation.py”, line 52, in test_no_write_access
with self.assertRaisesMessage(
^^^^^^^^^^^^^^^^^
File “C:\Program Files\Python312\Lib\contextlib.py”, line 144, in exit
next(self.gen)
File “C:\Users\rajhi\django\django\test\testcases.py”, line 807, in _assert_raises_or_warns_cm
with func(expected_exception) as cm:
^^^^^^^^^^^^^^^^^
File “C:\Program Files\Python312\Lib\unittest\case.py”, line 263, in exit
self._raiseFailure(“{} not raised”.format(exc_name))
^^^^^^^^^^^^^^^^^
File “C:\Program Files\Python312\Lib\unittest\case.py”, line 200, in _raiseFailure
raise self.test_case.failureException(msg)
^^^^^^^^^^^^^^^^^
AssertionError: CommandError not raised


Ran 17941 tests in 226.963s

FAILED (failures=1, skipped=1373, expected failures=5)
Destroying test database for alias ‘default’ (‘default_1.sqlite3’)…
Destroying test database for alias ‘default’ (‘default_2.sqlite3’)…
Destroying test database for alias ‘default’ (‘default_3.sqlite3’)…
Destroying test database for alias ‘default’ (‘default_4.sqlite3’)…
Destroying test database for alias ‘default’ (‘default_5.sqlite3’)…
Destroying test database for alias ‘default’ (‘default_6.sqlite3’)…
Destroying test database for alias ‘default’ (‘default_7.sqlite3’)…
Destroying test database for alias ‘default’ (‘default_8.sqlite3’)…
Destroying test database for alias ‘default’ (‘default_9.sqlite3’)…
Destroying test database for alias ‘default’ (‘default_10.sqlite3’)…
Destroying test database for alias ‘default’ (‘default_11.sqlite3’)…
Destroying test database for alias ‘default’ (‘default_12.sqlite3’)…
Destroying test database for alias ‘default’ (‘default_13.sqlite3’)…
Destroying test database for alias ‘default’ (‘default_14.sqlite3’)…
Destroying test database for alias ‘default’ (‘default_15.sqlite3’)…
Destroying test database for alias ‘default’ (‘default_16.sqlite3’)…
Destroying test database for alias ‘default’ (‘file:memorydb_default?mode=memory&cache=shared’)…
Destroying test database for alias ‘other’ (‘other_1.sqlite3’)…
Destroying test database for alias ‘other’ (‘other_2.sqlite3’)…
Destroying test database for alias ‘other’ (‘other_3.sqlite3’)…
Destroying test database for alias ‘other’ (‘other_4.sqlite3’)…
Destroying test database for alias ‘other’ (‘other_5.sqlite3’)…
Destroying test database for alias ‘other’ (‘other_6.sqlite3’)…
Destroying test database for alias ‘other’ (‘other_7.sqlite3’)…
Destroying test database for alias ‘other’ (‘other_8.sqlite3’)…
Destroying test database for alias ‘other’ (‘other_9.sqlite3’)…
Destroying test database for alias ‘other’ (‘other_10.sqlite3’)…
Destroying test database for alias ‘other’ (‘other_11.sqlite3’)…
Destroying test database for alias ‘other’ (‘other_12.sqlite3’)…
Destroying test database for alias ‘other’ (‘other_13.sqlite3’)…
Destroying test database for alias ‘other’ (‘other_14.sqlite3’)…
Destroying test database for alias ‘other’ (‘other_15.sqlite3’)…
Destroying test database for alias ‘other’ (‘other_16.sqlite3’)…
Destroying test database for alias ‘other’ (‘file:memorydb_other?mode=memory&cache=shared’)…

is it nesessary to solve the error or keeping them as it is ohk
as i am new to all this somplease help me in this

Hi Vaishnavraj2509, ideally yes. It’s probably worth you spending 30 minutes or so investigating why this test is failing.

However, in my opinion it is not necessary for this one test to pass locally, unless the test that is failing are in the area that you’re going to be working in. In the case that you are going to be making changes in the area of the failing tests, then you definitely need to solve this before implementing any changes to Django.

However, my guess is that you aren’t since that’s one test out of 17,000. Just run the tests that are relevant to your change until you’re more comfortable to tackle the setup problem.

This other recent thread has a similar issue: Running tests first time to check Django installation

1 Like

Please see this topic for additional advice: Error/Failure in Django local clone steup

Hi @Vaishnavraj2509 I’m Adya, I have also faced such errors.
What’s your OS? I think the issue is related to Django i18n.
You can try unit tests Unit tests | Django documentation | Django to confirm exact issue.

I solved my issue by doing iteration unit testing, checking my venv, and I also had to change my OS

I think this command will help you to understand the error in detail

python manage.py compilemessages --verbosity=3

python runtests.py i18n --verbosity=2

for linux and mac ./runtests.py i18n

here is the i18n related unit tests docs

check both docs!

good luck

1 Like

Hey @adyaprasad I am working on windows and geritng much issues as many things are even not clear for me I am too frustrated what to do and what not to do how to solve this error and others stuff !

Hello @CodenameTim thanks for your opinion but still I am clueless how to make changes according to me and run those test according to my test it’s very frustrating for me just need detailed help please :folded_hands:

I can relate!

I recommend you follow:

  • Read docs before starting
  • I strongly recommend you to read previously mention docs thoroughly
  • Iterate over the messages
  • Try to set up again from scratch and read the docs steps cautiously. Specially in which folder and directory you are currently, different steps can be performed in different directories
  • create and activate venv carefully
  • install all requirements if required:
py -m pip install -r requirements\py3.txt
py -m pip install -r requirements\mysql.txt
py -m pip install -r requirements\postgres.txt
  • run all tests and unit tests specifically
  • If anything does not work, try to use with wsl or step from scratch on linux or mac if you have.

Try to ask in Discord

:crossed_fingers:

1 Like