hello everyone,
I created a few tests and ran them locally, these basically refer to my urls, and they all pass on my local maching. I have pulled the exact same code to my PythonAnywhere app and running the tests results in PythonAnywhere results in all of my "pages app urls related" tests failing. I am posting the first couple tests below.
from django.test import SimpleTestCase
from django.urls import reverse, resolve
from .views import HomePageView
class HomepageTests(SimpleTestCase):
def setUp(self):
url = reverse("home")
self.response = self.client.get(url)
def test_url_exists_at_correct_location(self):
self.assertEqual(self.response.status_code, 200)
def test_homepage_template(self):
self.assertTemplateUsed(self.response, "home.html")
And these are the corresponding error messages:
ERROR: test_url_exists_at_correct_location (pages.tests.HomepageTests)
----------------------------------------------------------------------
Traceback (most recent call last): File "/home/afduggirala/.virtualenvs/yogasiteenv/lib/python3.10/site-packages/django/core/handlers/exception.py", line 56, in inner
response = get_response(request) File "/home/afduggirala/.virtualenvs/yogasiteenv/lib/python3.10/site-packages/django/utils/deprecation.py", line 133, in __call__
response = self.process_request(request) File "/home/afduggirala/.virtualenvs/yogasiteenv/lib/python3.10/site-packages/django/contrib/messages/middleware.py", line 12, in process_ request
request._messages = default_storage(request) File "/home/afduggirala/.virtualenvs/yogasiteenv/lib/python3.10/site-packages/django/contrib/messages/storage/__init__.py", line 12, in de fault_storage
return import_string(settings.MESSAGE_STORAGE)(request) File "/home/afduggirala/.virtualenvs/yogasiteenv/lib/python3.10/site-packages/django/contrib/messages/storage/fallback.py", line 16, in __ init__
self.storages = [ File "/home/afduggirala/.virtualenvs/yogasiteenv/lib/python3.10/site-packages/django/contrib/messages/storage/fallback.py", line 17, in <l istcomp>
....
I think I am not taking into account something about how PythonAnywhere works in terms of urls or paths, but I don't know what it is.
thanks very much,