I do not know your code, but the ImportError at the top of the error output says it cannot find your module lists.tests. You stated that you were modifying lists.test.py. This seems to indicate that the file should be tests.py instead of test.py, or you reference to import is should be lists.test.
Did you try this before you modified the lists/test.py module? Did a name get changed somewhere?
On Wednesday, July 31, 2019 at 8:38:22 AM UTC-5, Богдан Сиващенко wrote:
Hello everybody,My name is Bohdan and I'm new to Django.I've got a strange error while modifying lists/test.py. Here is what i get when I run it:
$python3 manage.py testCreating test database for alias 'default'...E======================================================================ERROR: lists.tests (unittest.loader._FailedTest)----------------------------------------------------------------------ImportError: Failed to import test module: lists.testsTraceback (most recent call last):File "/usr/lib/python3.7/unittest/loader.py", line 436, in _find_test_pathmodule = self._get_module_from_name(name)File "/usr/lib/python3.7/unittest/loader.py", line 377, in _get_module_from_name__import__(name)File "/home/bohdan/Documents/TG_01/superlists/lists/tests.py", line 4, in <module>from django.template.loader import render_to_srting
ImportError: cannot import name y",from 'django.template.loader' (/usr/local/lib/python3.7/dist-packages/django/template/loader.py)
Another note (apparently it IS finding the tests.py file): The ImportError has what could be a typo. It is looking for "render_to_srting", instead of what I assume you meant, "render_to_string". This of course causes it to fail the import, because the one you typed does not exist.
On Wednesday, July 31, 2019 at 1:41:46 PM UTC-5, Arnie Elkins wrote:
I do not know your code, but the ImportError at the top of the error output says it cannot find your module lists.tests. You stated that you were modifying lists.test.py. This seems to indicate that the file should be tests.py instead of test.py, or you reference to import is should be lists.test.
Did you try this before you modified the lists/test.py module? Did a name get changed somewhere?
On Wednesday, July 31, 2019 at 8:38:22 AM UTC-5, Богдан Сиващенко wrote:
Hello everybody,My name is Bohdan and I'm new to Django.
I've got a strange error while modifying lists/tests.py. Here is what i get when I run it: