Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests failing for system languages other than english #17367

Open
barredterra opened this issue Apr 24, 2019 · 1 comment
Open

Tests failing for system languages other than english #17367

barredterra opened this issue Apr 24, 2019 · 1 comment
Labels
to-validate Old issues pending validation

Comments

@barredterra
Copy link
Collaborator

barredterra commented Apr 24, 2019

Reproduce

  1. Set up a new system with any language other than English.
  2. Run tests bench run-tests

Error

Traceback (most recent call last):
  File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 97, in <module>
    main()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 25, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/utils.py", line 419, in run_tests
    ui_tests = ui_tests, doctype_list_path = doctype_list_path, failfast=failfast)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/test_runner.py", line 70, in main
    ret = run_all_tests(app, verbose, profile, ui_tests, failfast=failfast)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/test_runner.py", line 112, in run_all_tests
    test_suite, ui_tests)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/test_runner.py", line 240, in _add_test
    make_test_records(doctype, verbose)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/test_runner.py", line 257, in make_test_records
    make_test_records(options, verbose, force)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/test_runner.py", line 257, in make_test_records
    make_test_records(options, verbose, force)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/test_runner.py", line 258, in make_test_records
    make_test_records_for_doctype(options, verbose, force)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/test_runner.py", line 306, in make_test_records_for_doctype
    frappe.local.test_objects[doctype] += make_test_objects(doctype, test_module.test_records, verbose, force)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/test_runner.py", line 357, in make_test_objects
    d.insert()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 216, in insert
    self._validate_links()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 741, in _validate_links
    frappe.LinkValidationError)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 352, in throw
    msgprint(msg, raise_exception=exc, title=title, indicator='red')
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 338, in msgprint
    _raise_exception()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 311, in _raise_exception
    raise raise_exception(msg)
frappe.exceptions.LinkValidationError: Could not find Parent Customer Group: All Customer Groups

Cause

Many standard documents will be translated to the system language. Therefore the English names are not available. ("All Customer Groups" is replaced by "Alle Kundengruppen" in German)

Some affected DocTypes:

  • Customer Group
  • Item Group
  • Opportunity Type
  • Opportunity Source

This problem also affects production systems:

Possible Solution

  • Do not translate the name of standard documents.
  • Instead, use the new translatable checkbox on title field

Version

ERPNext: v11.1.22 (master)
Frappe Framework: v11.1.22 (master)

@scmmishra
Copy link
Contributor

Tests on local setup wont work as required without completing the setup for ERPNext. Can you please check if you've done that, if not see if the issue still persists after completing the setup.

@ankush ankush added the to-validate Old issues pending validation label Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to-validate Old issues pending validation
Projects
None yet
Development

No branches or pull requests

3 participants