I am working on a django tutorial and I am trying to run test cases using pycharm. However, I ran into a problem. When I run the command: app test
I came across this exception: the test environment terminated unexpectedly:
F:\programming\Python\python.exe "F:\programming\JetBrains\PyCharm 2017.2.4\helpers\pycharm\django_test_manage.py" test a F:\programming\Projects\pycharm\untitled
Testing started at 4:54 PM ...
Traceback (most recent call last):
File "F:\programming\JetBrains\PyCharm 2017.2.4\helpers\pycharm\django_test_manage.py", line 157, in <module>
utility.execute()
File "F:\programming\JetBrains\PyCharm 2017.2.4\helpers\pycharm\django_test_manage.py", line 110, in execute
from django_test_runner import is_nosetest
File "F:\programming\JetBrains\PyCharm 2017.2.4\helpers\pycharm\django_test_runner.py", line 42, in <module>
from django.utils import unittest
ImportError: cannot import name 'unittest'
Process finished with exit code 1
Apparently the django_test_manage.py file is not working. How can i fix this? this happens even when the test.py class is empty. So there must be a problem with pycharm then (?) I am using Pycharm Pro 2017.2.4, Django 2.0 and Python 3.6 My start / debug configurations are just the basic, pre-configured Django settings that pycharm does
Thank you!
source
share