Django Unit Test login

I am trying to do a Unit-Test to check that an authenticated user accesses the url /downloads on my Django site but I get the following error:

django.db.utils.ProgrammingError: (1146, "1146 (42S02): Table 'test_my_db_dev.filminfo' doesn't exist", '42S02')

My Unit-Test looks like this:

from django.test import TestCase


class TestLoginView(TestCase):
    def test_authenticated_user_can_see_page(self):
        user = User.objects.create_user("SomeUser," "some_user@mymail.net", "my_testP@ss!")
        self.client.force_login(user=user)
        response = self.client.get("/downloads")
        self.assertEqual(response.status_code, 200)

I would appreciate any help/comments. Thanks :)

Back to Top