Skip to content

Running tests now requires compilemessages #2258

@tim-schilling

Description

@tim-schilling

I believe PR #2213 may have introduced the need for the French translations to exist. Running make test with a fresh clone and following the README instructions will result in the following error (or deleting the relevant docs/locale/fr/*.mo files):

❯ python manage.py test --keepdb djangoproject.tests.LocaleSmokeTests
Found 3 test(s).
Using existing test database for alias 'default'...
System check identified no issues (1 silenced).
.F.
======================================================================
FAIL: test_docs_locale (djangoproject.tests.LocaleSmokeTests.test_docs_locale)
docs/locale/ should contain translations for 'Using Django'
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/schillingt/Projects/djangoproject.com/djangoproject/tests.py", line 33, in test_docs_locale
    self.assertEqual(
    ~~~~~~~~~~~~~~~~^
        translated,
        ^^^^^^^^^^^
        "Utilisation de Django",
        ^^^^^^^^^^^^^^^^^^^^^^^^
        msg="docs/locale/ translation not loaded or incorrect",
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
AssertionError: 'Using Django' != 'Utilisation de Django'
- Using Django
+ Utilisation de Django
 : docs/locale/ translation not loaded or incorrect

----------------------------------------------------------------------
Ran 3 tests in 0.012s

FAILED (failures=1)
Preserving test database for alias 'default'...

This works in CI because make ci first runs make compilemessages. I think updating the README set up docs to also include make compilemessages would be sufficient.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions