Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hstandeffer opened this issue Oct 9, 2019 · 5 comments · May be fixed by #111
Open

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

hstandeffer opened this issue Oct 9, 2019 · 5 comments · May be fixed by #111
Labels
bug 🐛 Something isn't working help wanted 🙌 Extra attention is needed

Comments

@hstandeffer
Copy link

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
Copy link
Collaborator

#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'.

@Animesh-Ghosh Animesh-Ghosh added bug 🐛 Something isn't working help wanted 🙌 Extra attention is needed labels Oct 9, 2019
@hstandeffer
Copy link
Author

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
Copy link
Collaborator

Animesh-Ghosh commented Oct 16, 2019

Did you see my comments in #9?

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

@Bhupesh-V
Copy link
Owner

`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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working help wanted 🙌 Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants