Bhupesh-V / tutorialdb

A search 🔎 engine for programming/dev tutorials,
MIT License
121 stars 60 forks source link

Tests failing with 'ModuleNotFoundError: No module named 'django.utils.six'' #94

Closed NewmanJ1987 closed 4 years ago

NewmanJ1987 commented 4 years ago

Describe the bug A new user following the guide to run the project. When you try to run the tests as per the setup guide you have the following error Traceback (most recent call last): File "/root/tutorialdb/app/tests/test_views.py", line 57, in test_tags_page_name response = self.client.get('/tags/') File "/usr/local/lib/python3.7/site-packages/django/test/client.py", line 518, in get response = super().get(path, data=data, secure=secure, **extra) File "/usr/local/lib/python3.7/site-packages/django/test/client.py", line 346, in get **extra, File "/usr/local/lib/python3.7/site-packages/django/test/client.py", line 421, in generic return self.request(**r) File "/usr/local/lib/python3.7/site-packages/django/test/client.py", line 484, in request response = self.handler(environ) File "/usr/local/lib/python3.7/site-packages/django/test/client.py", line 126, in __call__ self.load_middleware() File "/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py", line 35, in load_middleware middleware = import_string(middleware_path) File "/usr/local/lib/python3.7/site-packages/django/utils/module_loading.py", line 17, in import_string module = import_module(module_path) File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/usr/local/lib/python3.7/site-packages/whitenoise/middleware.py", line 5, in <module> from whitenoise.django import DjangoWhiteNoise File "/usr/local/lib/python3.7/site-packages/whitenoise/django.py", line 18, in <module> from django.utils.six.moves.urllib.parse import urlparse ModuleNotFoundError: No module named 'django.utils.six'

To Reproduce Steps to reproduce the behavior:

  1. Ran the project in a docker https://hub.docker.com/_/python tag 3.7

  2. pip installed the requirements

  3. Edited the .env file.

  4. Ran python mange.py migrate

  5. Ran python manage.py test

  6. Got the errors above Expected behavior To see the test pass.

NewmanJ1987 commented 4 years ago

Seem version Django version >3 no longer supports six. I will just pin an older version

https://github.com/jazzband/django-sortedm2m/issues/151