Upgraded Django 2.2LTS to Django 3.2.9 along with a bunch of python packages. I expected problems but not this problem.
$ manage.py test app.tests.test_models
[snip]
Creating test database for alias ‘default’…
sqlite3.OperationalError: no such table: django_site
I just assumed I forgot to do migrations
$ manage.py makemigrations
No changes detected
$ manage.py migrate
Operations to perform:
Apply all migrations: account, admin, auth, contenttypes, app, sessions, sites, socialaccount
Running migrations:
No migrations to apply.
The table is there
$ sqlite3 db.sqlite3
sqlite> .tables django_site
django_site
django_site database schema look correct
Basic django User model tests
from django.contrib.auth import get_user_model
from django.test import TestCase
User = get_user_model()
class UserTestCase(TestCase):
def test_user_username(self):
user = User.objects.get(id=1)
self.assertTrue(len(user.username) > 0)
pass
def test_user_email(self):
user = User.objects.get(id=1)
self.assertNotIn('example2.org', user.email)
self.assertIn('example.org', user.email)
def test_user_permissons(self):
user = User.objects.get(id=1)
self.assertTrue(user.is_active)
self.assertFalse(user.is_staff)
self.assertFalse(user.is_superuser)
Same problem
$ manage.py test judgingportal.tests.test_tests.UserTestCase
django.db.utils.OperationalError: no such table: django_site
Any help would be appreciated. Thank you.