[ERROR]: Cannot run tests on Manufacturing

I am trying to create a test for the production planning module, but I can’t seem to get the test to run. Here is the error I get when trying to run the test for the doctype:

frappe@erpnext:~/frappe-bench$ bench run-tests --doctype Production_Planning_Tool
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 162, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/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 79, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
return process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/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 24, in func
ret = f(frappe.dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/utils.py”, line 302, in run_tests
force=context.force, profile=profile)
File “/home/frappe/frappe-bench/apps/frappe/frappe/test_runner.py”, line 35, in main
ret = run_tests_for_doctype(doctype, verbose, tests, force, profile)
File “/home/frappe/frappe-bench/apps/frappe/frappe/test_runner.py”, line 93, in run_tests_for_doctype
test_module = get_module_name(doctype, module, "test
")
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/init.py”, line 70, in get_module_name
app = scrub(app or get_module_app(module)),
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/init.py”, line 77, in get_module_app
return frappe.local.module_app[scrub(module)]
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/init.py”, line 17, in scrub
return frappe.scrub(txt)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 647, in scrub
return txt.replace(’ ‘,’
‘).replace(’-', '
').lower()
AttributeError: ‘NoneType’ object has no attribute ‘replace’

And here is what happens when I try to run it on the whole Manufacturing module (I have tried both capitalized and not):

frappe@erpnext:~/frappe-bench$ bench run-tests --module manufacturing --app erpnext
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 162, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/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 79, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/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 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/utils.py”, line 302, in run_tests
force=context.force, profile=profile)
File “/home/frappe/frappe-bench/apps/frappe/frappe/test_runner.py”, line 37, in main
ret = run_tests_for_module(module, verbose, tests, profile)
File “/home/frappe/frappe-bench/apps/frappe/frappe/test_runner.py”, line 102, in run_tests_for_module
module = importlib.import_module(module)
File “/usr/lib/python2.7/importlib/init.py”, line 37, in import_module
import(name)
ImportError: No module named manufacturing

Can anyone give me a hint as to what’s going wrong?

Hi @Ben_Cornwell_Mott,

Correct command : bench run-tests --doctype ‘Production Planning Tool’

Thanks, Rohit