Never mind. I've found the answer. The problem was that my app name
"messages" somehow clashed with the app "django.contrib.messages"
which was earlier in my INSTALLED_APPS. This didn't prevent my
project from working, but did confuse the test framework, which looked
in "django.contrib.messages"
I'm sorry for my inconsistency. I tried to "simplify", but made a
mistake. In fact, I used the app "messages" throughout, in my code
and in the test command. The project containing the app works fine.
In particular, the app "messages" is included in INSTALLED_APPS.
So, if the test "should work"
On Sep 5, 5:18 am, Rodney Topor wrote:
> I'm trying to use unit tests for the first time.
>
> In app/tests.py I have:
>
> import unittest
> from django.test.client import Client
>
> class IndexTest(unittest.TestCase):
> def test_index(self):
> client = Client()
> response = cli
I'm trying to use unit tests for the first time.
In app/tests.py I have:
import unittest
from django.test.client import Client
class IndexTest(unittest.TestCase):
def test_index(self):
client = Client()
response = client.get('/index/')
self.assertEqual(response.status
4 matches
Mail list logo