Bhupesh-V / tutorialdb

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

Static Files Bug when running 'manage.py test' for setup #52

Open hstandeffer opened 5 years ago

hstandeffer commented 5 years ago

Describe the bug The bug appears after going through the setup; the program is unable to locate the static files root directory. I have tried running python manage.py collectstatic while changing the static file paths which resolves most errors, but still leaves me with a final 404 error:

`FAIL: test_tutorials_page_status_code (api.tests.test_views.APITests)

Traceback (most recent call last): File "C:\Users\temp\hacktoberfest\tutorialdb\api\tests\test_views.py", line 8, in test_tutorials_page_status_code self.assertEquals(response.status_code, 200) AssertionError: 404 != 200`

To Reproduce Steps to reproduce the behavior:

  1. Go through the initial setup steps of creating venv and installing requirements
  2. After running the migrate command, run the test command from setup
  3. See error

Expected behavior Status code of 200, asserting page was created correctly

Animesh-Ghosh commented 5 years ago

43 may be a possible fix.

I tried it out, but the error that is coming now is ValueError: Missing staticfiles manifest entry for 'app/tutorialdb.png'.

hstandeffer commented 4 years ago

I've continued trying to resolve this issue, but am having no luck. Are there any updates on getting this to correctly load the database?

Animesh-Ghosh commented 4 years ago

Did you see my comments in #9?

You need to specify a .env file. Have you worked with .env files before?

Bhupesh-V commented 4 years ago

`FAIL: test_tutorials_page_status_code (api.tests.test_views.APITests)

this test will fail due to reasons I am still not able to understand. you can ignore this message.

Aashish095 commented 1 year ago

Firstly i change {% load staticfiles %} to {% load static %} static file issue resolve and then the 404 error because api url not found so i added the /api/tutorials/ then it work find i hope this will help to fix your issue